Module: RSchema::Coercers::Symbol
Instance Method Summary collapse
Instance Method Details
#build(schema) ⇒ Object
7 8 9 |
# File 'lib/rschema/coercers/symbol.rb', line 7 def build(schema) self end |
#call(value) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/rschema/coercers/symbol.rb', line 11 def call(value) case value when ::Symbol then Result.success(value) when ::String then Result.success(value.to_sym) else Result.failure end end |
#will_affect?(value) ⇒ Boolean
19 20 21 |
# File 'lib/rschema/coercers/symbol.rb', line 19 def will_affect?(value) not value.is_a?(Symbol) end |