Class: Apia::DSLs::Polymorph

Inherits:
Apia::DSL show all
Defined in:
lib/apia/dsls/polymorph.rb

Instance Method Summary collapse

Methods inherited from Apia::DSL

#description, #initialize, #name, #no_schema

Constructor Details

This class inherits a constructor from Apia::DSL

Instance Method Details

#option(name, type: nil, matcher: nil) ⇒ Object



11
12
13
14
15
# File 'lib/apia/dsls/polymorph.rb', line 11

def option(name, type: nil, matcher: nil)
  id = "#{@definition.id}/#{Helpers.camelize(name)}Option"
  option = Definitions::PolymorphOption.new(id, name, type: type, matcher: matcher)
  @definition.options[name.to_sym] = option
end