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.



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

Returns:

  • (Boolean)


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

def oncreate?
  updatability == 'oncreate'
end

#readonly?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/cmis/property_definition.rb', line 11

def readonly?
  updatability == 'readonly'
end

#readwrite?Boolean

Returns:

  • (Boolean)


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

def readwrite?
  updatability == 'readwrite'
end

#to_hashObject



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

def to_hash
  @hash
end