Class: Gcpc::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/gcpc/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



8
9
10
# File 'lib/gcpc/config.rb', line 8

def initialize
  @beat = []
end

Instance Attribute Details

#beatObject (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

Raises:

  • (ArgumentError)


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