Class: CMIS::PropertyDefinition

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

Instance Method Summary collapse

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_hashObject



24
25
26
# File 'lib/cmis/property_definition.rb', line 24

def to_hash
  @hash
end