Class: FrOData::Properties::Enum
- Inherits:
-
FrOData::Property
- Object
- FrOData::Property
- FrOData::Properties::Enum
- Defined in:
- lib/frodata/properties/enum.rb
Overview
Abstract base class for FrOData EnumTypes
Instance Attribute Summary
Attributes inherited from FrOData::Property
Instance Method Summary collapse
-
#url_value ⇒ String
Value to be used in URLs.
-
#value ⇒ String?
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, #type, #xml_value
Constructor Details
This class inherits a constructor from FrOData::Property
Instance Method Details
#url_value ⇒ String
Value to be used in URLs.
25 26 27 |
# File 'lib/frodata/properties/enum.rb', line 25 def url_value "#{type}'#{@value}'" end |
#value ⇒ String?
Returns the property value, properly typecast
8 9 10 11 12 13 14 |
# File 'lib/frodata/properties/enum.rb', line 8 def value if @value.nil? && allows_nil? nil else @value end end |
#value=(new_value) ⇒ Object
Sets the property value
18 19 20 21 |
# File 'lib/frodata/properties/enum.rb', line 18 def value=(new_value) parsed_value = validate(new_value) @value = is_flags? ? parsed_value : parsed_value.first end |