Class: Nidyx::Property
- Inherits:
-
Object
- Object
- Nidyx::Property
- Defined in:
- lib/nidyx/property.rb
Defined Under Namespace
Classes: EmptyEnumError, NonArrayEnumError, UndefinedTypeError
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#collection_types ⇒ Object
readonly
Returns the value of attribute collection_types.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#enum ⇒ Object
readonly
Returns the value of attribute enum.
-
#minimum ⇒ Object
readonly
Returns the value of attribute minimum.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#optional ⇒ Object
readonly
Returns the value of attribute optional.
-
#overriden_name ⇒ Object
Returns the value of attribute overriden_name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #has_properties? ⇒ Boolean
-
#initialize(name, class_name, optional, obj) ⇒ Property
constructor
A new instance of Property.
Constructor Details
#initialize(name, class_name, optional, obj) ⇒ Property
Returns a new instance of Property.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/nidyx/property.rb', line 16 def initialize(name, class_name, optional, obj) @name = name.camelize(false) @class_name = class_name @optional = optional @enum = obj[ENUM_KEY] @type = process_type(obj[TYPE_KEY], @enum) @description = obj[DESCRIPTION_KEY] @properties = obj[PROPERTIES_KEY] @collection_types = obj[COLLECTION_TYPES_KEY] @minimum = obj[MINIMUM_KEY] end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
9 10 11 |
# File 'lib/nidyx/property.rb', line 9 def class_name @class_name end |
#collection_types ⇒ Object (readonly)
Returns the value of attribute collection_types.
9 10 11 |
# File 'lib/nidyx/property.rb', line 9 def collection_types @collection_types end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'lib/nidyx/property.rb', line 9 def description @description end |
#enum ⇒ Object (readonly)
Returns the value of attribute enum.
9 10 11 |
# File 'lib/nidyx/property.rb', line 9 def enum @enum end |
#minimum ⇒ Object (readonly)
Returns the value of attribute minimum.
9 10 11 |
# File 'lib/nidyx/property.rb', line 9 def minimum @minimum end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/nidyx/property.rb', line 9 def name @name end |
#optional ⇒ Object (readonly)
Returns the value of attribute optional.
9 10 11 |
# File 'lib/nidyx/property.rb', line 9 def optional @optional end |
#overriden_name ⇒ Object
Returns the value of attribute overriden_name.
8 9 10 |
# File 'lib/nidyx/property.rb', line 8 def overriden_name @overriden_name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/nidyx/property.rb', line 9 def type @type end |
Instance Method Details
#has_properties? ⇒ Boolean
28 29 30 |
# File 'lib/nidyx/property.rb', line 28 def has_properties? !!@properties end |