Class: YACCL::Model::PropertyDefinition
- Inherits:
-
Object
- Object
- YACCL::Model::PropertyDefinition
- Defined in:
- lib/yaccl/model/property_definition.rb
Instance Attribute Summary collapse
-
#cardinality ⇒ Object
Returns the value of attribute cardinality.
-
#description ⇒ Object
Returns the value of attribute description.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#inherited ⇒ Object
Returns the value of attribute inherited.
-
#local_name ⇒ Object
Returns the value of attribute local_name.
-
#open_choice ⇒ Object
Returns the value of attribute open_choice.
-
#orderable ⇒ Object
Returns the value of attribute orderable.
-
#other ⇒ Object
Returns the value of attribute other.
-
#property_type ⇒ Object
Returns the value of attribute property_type.
-
#query_name ⇒ Object
Returns the value of attribute query_name.
-
#queryable ⇒ Object
Returns the value of attribute queryable.
-
#required ⇒ Object
Returns the value of attribute required.
-
#updatability ⇒ Object
Returns the value of attribute updatability.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ PropertyDefinition
constructor
A new instance of PropertyDefinition.
- #method_missing(m, *args, &block) ⇒ Object
- #oncreate? ⇒ Boolean
- #readonly? ⇒ Boolean
- #readwrite? ⇒ Boolean
- #to_hash ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ PropertyDefinition
Returns a new instance of PropertyDefinition.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/yaccl/model/property_definition.rb', line 10 def initialize(hash={}) @id = hash.delete(:id) @local_name = hash.delete(:localName) @query_name = hash.delete(:queryName) @description = hash.delete(:description) @inherited = hash.delete(:inherited) @open_choice = hash.delete(:openChoice) @orderable = hash.delete(:orderable) @property_type = hash.delete(:propertyType) @updatability = hash.delete(:updatability) @display_name = hash.delete(:displayName) @required = hash.delete(:required) @cardinality = hash.delete(:cardinality) @queryable = hash.delete(:queryable) @other = hash end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/yaccl/model/property_definition.rb', line 39 def method_missing(m, *args, &block) if @other.has_key?(m) @other[m] else super end end |
Instance Attribute Details
#cardinality ⇒ Object
Returns the value of attribute cardinality.
5 6 7 |
# File 'lib/yaccl/model/property_definition.rb', line 5 def cardinality @cardinality end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/yaccl/model/property_definition.rb', line 5 def description @description end |
#display_name ⇒ Object
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 |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/yaccl/model/property_definition.rb', line 5 def id @id end |
#inherited ⇒ Object
Returns the value of attribute inherited.
5 6 7 |
# File 'lib/yaccl/model/property_definition.rb', line 5 def inherited @inherited end |
#local_name ⇒ Object
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_choice ⇒ Object
Returns the value of attribute open_choice.
5 6 7 |
# File 'lib/yaccl/model/property_definition.rb', line 5 def open_choice @open_choice end |
#orderable ⇒ Object
Returns the value of attribute orderable.
5 6 7 |
# File 'lib/yaccl/model/property_definition.rb', line 5 def orderable @orderable end |
#other ⇒ Object
Returns the value of attribute other.
5 6 7 |
# File 'lib/yaccl/model/property_definition.rb', line 5 def other @other end |
#property_type ⇒ Object
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_name ⇒ Object
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 |
#queryable ⇒ Object
Returns the value of attribute queryable.
5 6 7 |
# File 'lib/yaccl/model/property_definition.rb', line 5 def queryable @queryable end |
#required ⇒ Object
Returns the value of attribute required.
5 6 7 |
# File 'lib/yaccl/model/property_definition.rb', line 5 def required @required end |
#updatability ⇒ Object
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
31 32 33 |
# File 'lib/yaccl/model/property_definition.rb', line 31 def oncreate? updatability == 'oncreate' end |
#readonly? ⇒ Boolean
27 28 29 |
# File 'lib/yaccl/model/property_definition.rb', line 27 def readonly? updatability == 'readonly' end |
#readwrite? ⇒ Boolean
35 36 37 |
# File 'lib/yaccl/model/property_definition.rb', line 35 def readwrite? updatability == 'readwrite' end |
#to_hash ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/yaccl/model/property_definition.rb', line 47 def to_hash hash = {} hash[:id] = id hash[:localName] = local_name hash[:queryName] = query_name hash[:description] = description hash[:inherited] = inherited hash[:openChoice] = open_choice hash[:orderable] = orderable hash[:propertyType] = property_type hash[:updatability] = updatability hash[:displayName] = display_name hash[:required] = required hash[:cardinality] = cardinality hash[:queryable] = queryable hash.merge(other) end |