Module: Wrest::Components::TypecastHelpers
- Defined in:
- lib/wrest/components/typecast_helpers.rb
Overview
Provides helper methods which build lambdas to cast strings to specific types.
Instance Method Summary collapse
- #as_base64Binary ⇒ Object
- #as_boolean ⇒ Object
- #as_date ⇒ Object
- #as_datetime ⇒ Object
- #as_decimal ⇒ Object
- #as_float ⇒ Object
- #as_integer ⇒ Object
- #as_symbol ⇒ Object
- #as_yaml ⇒ Object
Instance Method Details
#as_base64Binary ⇒ Object
5 6 7 |
# File 'lib/wrest/components/typecast_helpers.rb', line 5 def as_base64Binary ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING['base64Binary'] end |
#as_boolean ⇒ Object
9 10 11 |
# File 'lib/wrest/components/typecast_helpers.rb', line 9 def as_boolean ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING['boolean'] end |
#as_date ⇒ Object
17 18 19 |
# File 'lib/wrest/components/typecast_helpers.rb', line 17 def as_date ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING['date'] end |
#as_datetime ⇒ Object
21 22 23 |
# File 'lib/wrest/components/typecast_helpers.rb', line 21 def as_datetime ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING['datetime'] end |
#as_decimal ⇒ Object
13 14 15 |
# File 'lib/wrest/components/typecast_helpers.rb', line 13 def as_decimal ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING['decimal'] end |
#as_float ⇒ Object
25 26 27 |
# File 'lib/wrest/components/typecast_helpers.rb', line 25 def as_float ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING['float'] end |
#as_integer ⇒ Object
29 30 31 |
# File 'lib/wrest/components/typecast_helpers.rb', line 29 def as_integer ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING['integer'] end |
#as_symbol ⇒ Object
33 34 35 |
# File 'lib/wrest/components/typecast_helpers.rb', line 33 def as_symbol ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING['symbol'] end |
#as_yaml ⇒ Object
37 38 39 |
# File 'lib/wrest/components/typecast_helpers.rb', line 37 def as_yaml ActiveSupport::CoreExtensions::Hash::Conversions::XML_PARSING['yaml'] end |