Class: Nidyx::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/nidyx/property.rb

Defined Under Namespace

Classes: EmptyEnumError, NonArrayEnumError, UndefinedTypeError

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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_typesObject (readonly)

Returns the value of attribute collection_types.



9
10
11
# File 'lib/nidyx/property.rb', line 9

def collection_types
  @collection_types
end

#descriptionObject (readonly)

Returns the value of attribute description.



9
10
11
# File 'lib/nidyx/property.rb', line 9

def description
  @description
end

#enumObject (readonly)

Returns the value of attribute enum.



9
10
11
# File 'lib/nidyx/property.rb', line 9

def enum
  @enum
end

#minimumObject (readonly)

Returns the value of attribute minimum.



9
10
11
# File 'lib/nidyx/property.rb', line 9

def minimum
  @minimum
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/nidyx/property.rb', line 9

def name
  @name
end

#optionalObject (readonly)

Returns the value of attribute optional.



9
10
11
# File 'lib/nidyx/property.rb', line 9

def optional
  @optional
end

#overriden_nameObject

Returns the value of attribute overriden_name.



8
9
10
# File 'lib/nidyx/property.rb', line 8

def overriden_name
  @overriden_name
end

#typeObject (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

Returns:

  • (Boolean)


28
29
30
# File 'lib/nidyx/property.rb', line 28

def has_properties?
  !!@properties
end