Class: Apia::Definitions::Polymorph

Inherits:
Apia::Definition show all
Defined in:
lib/apia/definitions/polymorph.rb

Instance Attribute Summary collapse

Attributes inherited from Apia::Definition

#description, #id, #name, #schema

Instance Method Summary collapse

Methods inherited from Apia::Definition

#initialize, #schema?

Constructor Details

This class inherits a constructor from Apia::Definition

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



11
12
13
# File 'lib/apia/definitions/polymorph.rb', line 11

def options
  @options
end

Instance Method Details

#dslObject



17
18
19
# File 'lib/apia/definitions/polymorph.rb', line 17

def dsl
  @dsl ||= DSLs::Polymorph.new(self)
end

#setupObject



13
14
15
# File 'lib/apia/definitions/polymorph.rb', line 13

def setup
  @options = {}
end

#validate(errors) ⇒ Object



21
22
23
24
25
# File 'lib/apia/definitions/polymorph.rb', line 21

def validate(errors)
  @options.each_value do |option|
    option.validate(errors)
  end
end