Class: CMIS::PropertyDefinition
- Inherits:
-
Object
- Object
- CMIS::PropertyDefinition
- Defined in:
- lib/cmis/property_definition.rb
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ PropertyDefinition
constructor
A new instance of PropertyDefinition.
- #oncreate? ⇒ Boolean
- #readonly? ⇒ Boolean
- #readwrite? ⇒ Boolean
- #to_hash ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ PropertyDefinition
3 4 5 6 7 8 9 10 |
# File 'lib/cmis/property_definition.rb', line 3 def initialize(hash = {}) @hash = hash.with_indifferent_access @hash.each_key do |key| class_eval "def #{key.underscore};@hash['#{key}'];end" class_eval "def #{key.underscore}=(value);@hash['#{key}']=value;end" end end |
Instance Method Details
#oncreate? ⇒ Boolean
16 17 18 |
# File 'lib/cmis/property_definition.rb', line 16 def oncreate? updatability == 'oncreate' end |
#readonly? ⇒ Boolean
12 13 14 |
# File 'lib/cmis/property_definition.rb', line 12 def readonly? updatability == 'readonly' end |
#readwrite? ⇒ Boolean
20 21 22 |
# File 'lib/cmis/property_definition.rb', line 20 def readwrite? updatability == 'readwrite' end |
#to_hash ⇒ Object
24 25 26 |
# File 'lib/cmis/property_definition.rb', line 24 def to_hash @hash end |