Class: Module

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

Instance Method Summary collapse

Instance Method Details

#bool_attr_reader(*attrs) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/roxml/definition.rb', line 4

def bool_attr_reader(*attrs)
  attrs.each do |attr|
    define_method :"#{attr}?" do
      instance_variable_get(:"@#{attr}") || false
    end
  end
end