Class: YACCL::Model::PropertyDefinition

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ PropertyDefinition

Returns a new instance of PropertyDefinition.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/yaccl/model/property_definition.rb', line 9

def initialize(hash={})
  @id = hash[:id]
  @local_name = hash[:localName]
  @query_name = hash[:queryName]
  @inherited = hash[:inherited]
  @open_choice = hash[:openChoice]
  @orderable = hash[:orderable]
  @property_type = hash[:propertyType]
  @updatability = hash[:updatability]
  @display_name = hash[:displayName]
  @required = hash[:required]
  @cardinality = hash[:cardinality]
  @queryable = hash[:queryable]
end

Instance Attribute Details

#cardinalityObject

Returns the value of attribute cardinality.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def cardinality
  @cardinality
end

#display_nameObject

Returns the value of attribute display_name.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def display_name
  @display_name
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def id
  @id
end

#inheritedObject

Returns the value of attribute inherited.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def inherited
  @inherited
end

#local_nameObject

Returns the value of attribute local_name.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def local_name
  @local_name
end

#open_choiseObject

Returns the value of attribute open_choise.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def open_choise
  @open_choise
end

#orderableObject

Returns the value of attribute orderable.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def orderable
  @orderable
end

#property_typeObject

Returns the value of attribute property_type.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def property_type
  @property_type
end

#query_nameObject

Returns the value of attribute query_name.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def query_name
  @query_name
end

#queryableObject

Returns the value of attribute queryable.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def queryable
  @queryable
end

#requiredObject

Returns the value of attribute required.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def required
  @required
end

#updatabilityObject

Returns the value of attribute updatability.



5
6
7
# File 'lib/yaccl/model/property_definition.rb', line 5

def updatability
  @updatability
end

Instance Method Details

#oncreate?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/yaccl/model/property_definition.rb', line 28

def oncreate?
  updatability == 'oncreate'
end

#readonly?Boolean

Returns:

  • (Boolean)


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

def readonly?
  updatability == 'readonly'
end

#readwrite?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/yaccl/model/property_definition.rb', line 32

def readwrite?
  updatability == 'readwrite'
end

#to_hashObject



36
37
38
# File 'lib/yaccl/model/property_definition.rb', line 36

def to_hash
  # TODO (Needed for updating type?)
end