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.
-
#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 |
# 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) @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
38 39 40 41 42 43 44 |
# File 'lib/yaccl/model/property_definition.rb', line 38 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 |
#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
30 31 32 |
# File 'lib/yaccl/model/property_definition.rb', line 30 def oncreate? updatability == 'oncreate' end |
#readonly? ⇒ Boolean
26 27 28 |
# File 'lib/yaccl/model/property_definition.rb', line 26 def readonly? updatability == 'readonly' end |
#readwrite? ⇒ Boolean
34 35 36 |
# File 'lib/yaccl/model/property_definition.rb', line 34 def readwrite? updatability == 'readwrite' end |
#to_hash ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/yaccl/model/property_definition.rb', line 46 def to_hash hash = {} hash[:id] = id hash[:localName] = local_name hash[:queryName] = query_name hash[:description] = description hash[:inherited] = inherited 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 |