Class: Module

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

Overview

oh ruby

Instance Method Summary collapse

Instance Method Details

#bool_accessor(*args) ⇒ Object



150
151
152
153
# File 'lib/whisper/common.rb', line 150

def bool_accessor *args
  bool_reader(*args)
  bool_writer(*args)
end

#bool_reader(*args) ⇒ Object



146
147
148
# File 'lib/whisper/common.rb', line 146

def bool_reader *args
  args.each { |sym| class_eval %{ def #{sym}?; @#{sym}; end } }
end

#bool_writer(*args) ⇒ Object



149
# File 'lib/whisper/common.rb', line 149

def bool_writer *args; attr_writer(*args); end