Class: Blacklight::Types::Value
- Inherits:
-
Object
- Object
- Blacklight::Types::Value
show all
- Defined in:
- app/values/blacklight/types.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.coerce(input) ⇒ Object
15
16
17
|
# File 'app/values/blacklight/types.rb', line 15
def self.coerce(input)
new.cast(input)
end
|
Instance Method Details
#cast(input) ⇒ Object
19
20
21
22
23
24
25
|
# File 'app/values/blacklight/types.rb', line 19
def cast(input)
if input.is_a?(::Array)
input.first
else
input
end
end
|