Class: Anchor::Types::Object
- Inherits:
-
Object
- Object
- Anchor::Types::Object
- Defined in:
- lib/anchor/types.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(properties) ⇒ Object
constructor
A new instance of Object.
Constructor Details
#initialize(properties) ⇒ Object
Returns a new instance of Object.
24 25 26 |
# File 'lib/anchor/types.rb', line 24 def initialize(properties) @properties = properties || [] end |
Instance Attribute Details
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
22 23 24 |
# File 'lib/anchor/types.rb', line 22 def properties @properties end |
Class Method Details
.properties ⇒ Object
29 30 31 |
# File 'lib/anchor/types.rb', line 29 def properties @properties ||= [] end |
.property(name, type, optional: nil, description: nil) ⇒ Object
33 34 35 36 |
# File 'lib/anchor/types.rb', line 33 def property(name, type, optional: nil, description: nil) @properties ||= [] @properties.push(Property.new(name, type, optional, description)) end |