Module: Unidata::Extensions::String

Included in:
String
Defined in:
lib/unidata/extensions/string.rb

Instance Method Summary collapse

Instance Method Details

#from_unidata(value) ⇒ Object



12
13
14
# File 'lib/unidata/extensions/string.rb', line 12

def from_unidata(value)
  typecast(value)
end

#to_unidata(value) ⇒ Object



8
9
10
# File 'lib/unidata/extensions/string.rb', line 8

def to_unidata(value)
  value.upcase
end

#typecast(value) ⇒ Object



4
5
6
# File 'lib/unidata/extensions/string.rb', line 4

def typecast(value)
  value.kind_of?(::String) ? value : value.to_s
end