Class: ShareWith::ServiceDataType::Select
- Inherits:
-
BasicDataType
- Object
- BasicDataType
- ShareWith::ServiceDataType::Select
- Defined in:
- lib/share_with/service_data.rb
Overview
Define a select value type.
Instance Attribute Summary
Attributes inherited from BasicDataType
Instance Method Summary collapse
- #attr(attr_value) ⇒ Object
-
#key ⇒ Object
aliasing the ancestor method to meet the new meanings.
- #value ⇒ Object
- #value=(val) ⇒ Object
Methods inherited from BasicDataType
Constructor Details
This class inherits a constructor from ShareWith::ServiceDataType::BasicDataType
Instance Method Details
#attr(attr_value) ⇒ Object
112 113 114 |
# File 'lib/share_with/service_data.rb', line 112 def attr(attr_value) @data[:options][key][:attr][attr_value] end |
#key ⇒ Object
aliasing the ancestor method to meet the new meanings
100 |
# File 'lib/share_with/service_data.rb', line 100 alias key value |
#value ⇒ Object
102 103 104 |
# File 'lib/share_with/service_data.rb', line 102 def value @data[:options][key].instance_of?(String) ? @data[:options][key] : @data[:options][key][:value] end |
#value=(val) ⇒ Object
106 107 108 109 110 |
# File 'lib/share_with/service_data.rb', line 106 def value=(val) raise InvalidValue, [val, @data[:options].keys] unless @data[:options].key? val @value = val end |