Class: Anchor::Types::Object

Inherits:
Object
  • Object
show all
Defined in:
lib/anchor/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#propertiesObject (readonly)

Returns the value of attribute properties.



22
23
24
# File 'lib/anchor/types.rb', line 22

def properties
  @properties
end

Class Method Details

.propertiesObject



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