class Bluepine::Attributes::BooleanAttribute
@example Registers custom normalizer that accepts “on” as truth value
BooleanAttribute.normalizer = ->(x) { ["on", true].include?(x) ? true : false }
@example Registers custom serializer
BooleanAttribute.serialize = ->(x) { x == "on" ? true : false }
Public Instance Methods
in()
click to toggle source
# File lib/bluepine/attributes/boolean_attribute.rb, line 17 def in @options.fetch(:in, [true, false]) end
native_type()
click to toggle source
# File lib/bluepine/attributes/boolean_attribute.rb, line 13 def native_type "boolean" end