Class: Ari::Generators::Property
- Inherits:
-
Object
- Object
- Ari::Generators::Property
- Defined in:
- lib/ari/generators/property.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(name, specification) ⇒ Property
constructor
A new instance of Property.
- #name ⇒ Object
- #required? ⇒ Boolean
- #type ⇒ Object
Constructor Details
#initialize(name, specification) ⇒ Property
Returns a new instance of Property.
5 6 7 8 |
# File 'lib/ari/generators/property.rb', line 5 def initialize(name, specification) @name = name @specification = specification end |
Instance Method Details
#description ⇒ Object
26 27 28 |
# File 'lib/ari/generators/property.rb', line 26 def description @specification['description'] end |
#name ⇒ Object
10 11 12 |
# File 'lib/ari/generators/property.rb', line 10 def name @name end |
#required? ⇒ Boolean
14 15 16 |
# File 'lib/ari/generators/property.rb', line 14 def required? @specification['required'] end |
#type ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/ari/generators/property.rb', line 18 def type if @specification['type'].start_with?('List[') @specification['type'][5..-2] else @specification['type'] == 'void' ? nil : @specification['type'] end end |