module Graphiti::Extensions::BooleanAttribute::ClassMethods
Public Instance Methods
boolean_attribute(name, options = {}, &blk)
click to toggle source
Register a boolean attribute @param name the corresponding ? method @param [Hash] options Normal .attribute options
# File lib/graphiti/extensions/boolean_attribute.rb, line 21 def boolean_attribute(name, options = {}, &blk) blk ||= proc { @object.public_send(name) } field_name = :"is_#{name.to_s.delete("?")}" attribute field_name, options, &blk end