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
Returns a new instance of PropertyDefinition.
3 4 5 6 7 8 9 |
# File 'lib/cmis/property_definition.rb', line 3 def initialize(hash = {}) @hash = hash.stringify_keys @hash.each_key do |key| self.class.class_eval "def #{key.as_ruby_property};@hash['#{key}'];end" self.class.class_eval "def #{key.as_ruby_property}=(value);@hash['#{key}']=value;end" end end |
Instance Method Details
#oncreate? ⇒ Boolean
15 16 17 |
# File 'lib/cmis/property_definition.rb', line 15 def oncreate? updatability == 'oncreate' end |
#readonly? ⇒ Boolean
11 12 13 |
# File 'lib/cmis/property_definition.rb', line 11 def readonly? updatability == 'readonly' end |
#readwrite? ⇒ Boolean
19 20 21 |
# File 'lib/cmis/property_definition.rb', line 19 def readwrite? updatability == 'readwrite' end |
#to_hash ⇒ Object
23 24 25 |
# File 'lib/cmis/property_definition.rb', line 23 def to_hash @hash end |