Class: FrOData::Properties::Float
- Inherits:
-
FrOData::Property
- Object
- FrOData::Property
- FrOData::Properties::Float
- Includes:
- Number
- Defined in:
- lib/frodata/properties/float.rb
Overview
Defines the Float FrOData type.
Instance Attribute Summary
Attributes inherited from FrOData::Property
Instance Method Summary collapse
-
#type ⇒ Object
The FrOData type name.
-
#value ⇒ Float?
Returns the property value, properly typecast.
-
#value=(new_value) ⇒ Object
Sets the property value.
Methods inherited from FrOData::Property
#==, #allows_nil?, #concurrency_mode, from_xml, #initialize, #json_value, #strict?, #to_xml, #url_value, #xml_value
Constructor Details
This class inherits a constructor from FrOData::Property
Instance Method Details
#type ⇒ Object
The FrOData type name
25 26 27 |
# File 'lib/frodata/properties/float.rb', line 25 def type 'Edm.Double' end |
#value ⇒ Float?
Returns the property value, properly typecast
9 10 11 12 13 14 15 |
# File 'lib/frodata/properties/float.rb', line 9 def value if (@value.nil? || @value.empty?) && allows_nil? nil else @value.to_f end end |
#value=(new_value) ⇒ Object
Sets the property value
19 20 21 22 |
# File 'lib/frodata/properties/float.rb', line 19 def value=(new_value) validate(new_value.to_f) @value = new_value.to_f.to_s end |