Class: Gcpc::Config
Instance Attribute Summary collapse
-
#beat ⇒ Object
readonly
Returns the value of attribute beat.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
8 9 10 |
# File 'lib/gcpc/config.rb', line 8 def initialize @beat = [] end |
Instance Attribute Details
#beat ⇒ Object (readonly)
Returns the value of attribute beat.
6 7 8 |
# File 'lib/gcpc/config.rb', line 6 def beat @beat end |
Instance Method Details
#on(event, &block) ⇒ Object
12 13 14 15 16 |
# File 'lib/gcpc/config.rb', line 12 def on(event, &block) raise ArgumentError, "Invalid event name: #{event}" if event != :beat @beat << block end |