Class: RSchema::Coercers::Any::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/rschema/coercers/any.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subbuilders) ⇒ Builder


26
27
28
# File 'lib/rschema/coercers/any.rb', line 26

def initialize(subbuilders)
  @subbuilders = subbuilders
end

Instance Attribute Details

#subbuildersObject (readonly)

Returns the value of attribute subbuilders


24
25
26
# File 'lib/rschema/coercers/any.rb', line 24

def subbuilders
  @subbuilders
end

Instance Method Details

#build(schema) ⇒ Object


30
31
32
33
34
35
# File 'lib/rschema/coercers/any.rb', line 30

def build(schema)
  subcoercers = subbuilders.map do |builder|
    builder.build(schema)
  end
  Any.new(subcoercers)
end