Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/active_rdf_helpers.rb

Instance Method Summary collapse

Instance Method Details

#bool_accessor(*syms) ⇒ Object

Adds boolean accessor to a class (e.g. person.male?)



7
8
9
10
11
# File 'lib/active_rdf_helpers.rb', line 7

def bool_accessor *syms
  attr_accessor(*syms)
  syms.each { |sym| alias_method "#{sym}?", sym }
  remove_method(*syms)
end