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.
6 7 8 9 10 11 12 |
# File 'lib/cmis/property_definition.rb', line 6 def initialize(hash = {}) @hash = hash.stringify_keys @hash.each_key do |key| self.class.class_eval "def #{key.underscore};@hash['#{key}'];end" self.class.class_eval "def #{key.underscore}=(value);@hash['#{key}']=value;end" end end |
Instance Method Details
#oncreate? ⇒ Boolean
18 19 20 |
# File 'lib/cmis/property_definition.rb', line 18 def oncreate? updatability == 'oncreate' end |
#readonly? ⇒ Boolean
14 15 16 |
# File 'lib/cmis/property_definition.rb', line 14 def readonly? updatability == 'readonly' end |
#readwrite? ⇒ Boolean
22 23 24 |
# File 'lib/cmis/property_definition.rb', line 22 def readwrite? updatability == 'readwrite' end |
#to_hash ⇒ Object
26 27 28 |
# File 'lib/cmis/property_definition.rb', line 26 def to_hash @hash end |