tainbox
tainbox copied to clipboard
New boolean attribute syntax
class User
attribute :admin?, default: false
end
person = User.new
person.admin? # => false
person.admin # => false
person.admin! # => #<User:0x00007fb0d45bb0f8 @tainbox_admin=true>
person.admin? # => true
person.admin # => true
person.attributes # => {:admin=>true}
person.as_json # => {"admin"=>true}