Class: TypedString

Inherits:
String
  • Object
show all
Defined in:
lib/gossamer/typed_string.rb

Instance Method Summary collapse

Constructor Details

#initialize(string, type) ⇒ TypedString

Returns a new instance of TypedString.



3
4
5
6
7
# File 'lib/gossamer/typed_string.rb', line 3

def initialize(string, type)
  super(string.to_s)
  @type = type
  @encoding = "utf8"
end

Instance Method Details

#typeObject



9
10
11
# File 'lib/gossamer/typed_string.rb', line 9

def type
  "#{@type}; charset=#{@encoding}"
end