Module: SMG::Mapping::TypeCasts
- Defined in:
- lib/smg/mapping/typecasts.rb
Class Attribute Summary collapse
-
.typecasts ⇒ Object
Returns the value of attribute typecasts.
Class Method Summary collapse
Class Attribute Details
.typecasts ⇒ Object
Returns the value of attribute typecasts.
10 11 12 |
# File 'lib/smg/mapping/typecasts.rb', line 10 def typecasts @typecasts end |
Class Method Details
.[](key, value) ⇒ Object
12 13 14 15 |
# File 'lib/smg/mapping/typecasts.rb', line 12 def [](key,value) return typecasts[key][value] if typecasts.key?(key) raise ArgumentError, "Can't typecast #{value.class} into #{key.inspect}" end |
.key?(key) ⇒ Boolean
17 18 19 |
# File 'lib/smg/mapping/typecasts.rb', line 17 def key?(key) typecasts.key?(key) end |