Class: Blacklight::Types::Selector
- Defined in:
- app/values/blacklight/types.rb
Instance Method Summary collapse
- #cast(input) ⇒ Object
-
#initialize(by: nil, block: nil, **kwargs) ⇒ Selector
constructor
A new instance of Selector.
Methods inherited from Value
Constructor Details
#initialize(by: nil, block: nil, **kwargs) ⇒ Selector
Returns a new instance of Selector.
98 99 100 101 102 |
# File 'app/values/blacklight/types.rb', line 98 def initialize(by: nil, block: nil, **kwargs) super(**kwargs) @by = by @block = block end |
Instance Method Details
#cast(input) ⇒ Object
104 105 106 107 108 |
# File 'app/values/blacklight/types.rb', line 104 def cast(input) return super.public_send(@by) unless @block super.public_send(@by, &@block) end |