Class: Jasonette::Properties::PropertyEnum
- Inherits:
-
Object
- Object
- Jasonette::Properties::PropertyEnum
- Includes:
- Enumerable
- Defined in:
- lib/jasonette/core/properties.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
- #has_type?(name, ptype) ⇒ Boolean
-
#initialize(properties = {}) ⇒ PropertyEnum
constructor
A new instance of PropertyEnum.
- #merge!(value) ⇒ Object
- #names ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(properties = {}) ⇒ PropertyEnum
Returns a new instance of PropertyEnum.
9 10 11 |
# File 'lib/jasonette/core/properties.rb', line 9 def initialize properties = {} @properties = properties end |
Instance Attribute Details
#properties ⇒ Object
Returns the value of attribute properties.
7 8 9 |
# File 'lib/jasonette/core/properties.rb', line 7 def properties @properties end |
Instance Method Details
#has_type?(name, ptype) ⇒ Boolean
21 22 23 |
# File 'lib/jasonette/core/properties.rb', line 21 def has_type?(name, ptype) value[name.to_sym][ptype.to_sym] rescue false end |
#merge!(value) ⇒ Object
13 14 15 16 |
# File 'lib/jasonette/core/properties.rb', line 13 def merge! value properties.merge! value if value.is_a? Hash properties.merge! value.properties if value.is_a? self.class end |
#names ⇒ Object
18 |
# File 'lib/jasonette/core/properties.rb', line 18 def names; properties.keys end |
#value ⇒ Object
19 |
# File 'lib/jasonette/core/properties.rb', line 19 def value; properties end |