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.
102 103 104 105 106 |
# File 'app/values/blacklight/types.rb', line 102 def initialize(by: nil, block: nil, **kwargs) super(**kwargs) @by = by @block = block end |
Instance Method Details
#cast(input) ⇒ Object
108 109 110 111 112 |
# File 'app/values/blacklight/types.rb', line 108 def cast(input) return super.public_send(@by) unless @block super.public_send(@by, &@block) end |