Class: Yaks::Mapper::Form::Fieldset

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/yaks/mapper/form/fieldset.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(options = {}, &block) ⇒ Object



10
11
12
# File 'lib/yaks/mapper/form/fieldset.rb', line 10

def self.create(options = {}, &block)
  new(config: Config.build(options, &block))
end

Instance Method Details

#to_resource_fields(mapper) ⇒ Object



14
15
16
17
# File 'lib/yaks/mapper/form/fieldset.rb', line 14

def to_resource_fields(mapper)
  return [] if config.if && !mapper.expand_value(config.if)
  [ Resource::Form::Fieldset.new(fields: config.to_resource_fields(mapper)) ]
end