Class: Yaks::Mapper::Form::Field::Option
- Inherits:
-
Object
- Object
- Yaks::Mapper::Form::Field::Option
- Defined in:
- lib/yaks/mapper/form/field/option.rb
Overview
<option>, as used in a <select>
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.create(value, opts) ⇒ Object
9 10 11 |
# File 'lib/yaks/mapper/form/field/option.rb', line 9 def self.create(value, opts) new(opts.merge(value: value)) end |
Instance Method Details
#to_resource_field_option(mapper) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/yaks/mapper/form/field/option.rb', line 13 def to_resource_field_option(mapper) return unless self.if.nil? || mapper.(self.if) Resource::Form::Field::Option.new( value: mapper.(value), label: mapper.(label), selected: mapper.(selected), disabled: mapper.(disabled) ) end |