Module: StayAwake

Defined in:
lib/stay_awake.rb,
lib/stay_awake/buzzer.rb,
lib/stay_awake/sinatra.rb,
lib/stay_awake/version.rb,
lib/stay_awake/strategy.rb,
lib/stay_awake/configuration.rb,
lib/stay_awake/strategies/httparty.rb,
lib/stay_awake/strategies/net_http.rb,
lib/stay_awake/strategies/em_http_request.rb

Defined Under Namespace

Modules: Sinatra, Strategies, Strategy Classes: Buzzer, Configuration, ConfigurationError

Constant Summary collapse

VERSION =
'0.0.1'

Class Method Summary collapse

Class Method Details

.buzzObject



23
24
25
# File 'lib/stay_awake.rb', line 23

def self.buzz
  Buzzer.instance.buzz
end

.buzzing?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/stay_awake.rb', line 27

def self.buzzing?
  Buzzer.instance.buzzing?
end

.configObject



6
7
8
# File 'lib/stay_awake.rb', line 6

def self.config
  Configuration.instance
end

.configure {|config| ... } ⇒ Object

Yields:



10
11
12
13
# File 'lib/stay_awake.rb', line 10

def self.configure(&block)
  yield config
  self
end

.loggerObject



15
16
17
# File 'lib/stay_awake.rb', line 15

def self.logger
  config.logger
end

.shut_offObject



31
32
33
# File 'lib/stay_awake.rb', line 31

def self.shut_off
  Buzzer.instance.shut_off
end

.strategiesObject



19
20
21
# File 'lib/stay_awake.rb', line 19

def self.strategies
  @strategies ||= []
end