Module: JsonapiCompliable::Extensions::BooleanAttribute::ClassMethods
- Defined in:
- lib/jsonapi_compliable/extensions/boolean_attribute.rb
Instance Method Summary collapse
Instance Method Details
#boolean_attribute(name, options = {}, &blk) ⇒ Object
9 10 11 12 13 |
# File 'lib/jsonapi_compliable/extensions/boolean_attribute.rb', line 9 def boolean_attribute(name, = {}, &blk) blk ||= proc { @object.public_send(name) } field_name = :"is_#{name.to_s.gsub('?', '')}" attribute field_name, , &blk end |