Class: CMIS::PropertyDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/cmis/property_definition.rb

Instance Method Summary collapse

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

Returns:



18
19
20
# File 'lib/cmis/property_definition.rb', line 18

def oncreate?
  updatability == 'oncreate'
end

#readonly?Boolean

Returns:



14
15
16
# File 'lib/cmis/property_definition.rb', line 14

def readonly?
  updatability == 'readonly'
end

#readwrite?Boolean

Returns:



22
23
24
# File 'lib/cmis/property_definition.rb', line 22

def readwrite?
  updatability == 'readwrite'
end

#to_hashObject



26
27
28
# File 'lib/cmis/property_definition.rb', line 26

def to_hash
  @hash
end