Module: Brawne

Defined in:
lib/brawne/request.rb,
lib/brawne.rb,
lib/brawne/version.rb

Overview

simple module to wrap up http requests.

Defined Under Namespace

Modules: Request

Constant Summary collapse

VERSION =
'0.0.6'
@@_ran_once =
false

Class Method Summary collapse

Class Method Details

.load_and_set_settings!Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/brawne.rb', line 16

def self.load_and_set_settings!
  Kernel.send(:remove_const, 'BRAWNE_HOST') if Kernel.const_defined?('BRAWNE_HOST')
  Kernel.const_set('BRAWNE_HOST', Brawne.host)
  Kernel.send(:remove_const, 'BRAWNE_PORT') if Kernel.const_defined?('BRAWNE_PORT')
  Kernel.const_set('BRAWNE_PORT', Brawne.port)
  Kernel.send(:remove_const, 'BRAWNE_SSL') if Kernel.const_defined?('BRAWNE_SSL')
  Kernel.const_set('BRAWNE_SSL', Brawne.ssl)
  Kernel.send(:remove_const, 'BRAWNE_USER') if Kernel.const_defined?('BRAWNE_USER')
  Kernel.const_set('BRAWNE_USER', Brawne.user)
  Kernel.send(:remove_const, 'BRAWNE_TOKEN') if Kernel.const_defined?('BRAWNE_TOKEN')
  Kernel.const_set('BRAWNE_TOKEN', Brawne.token)
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Brawne)

    the object that the method was called on



11
12
13
14
# File 'lib/brawne.rb', line 11

def self.setup
  yield self if @@_ran_once == false
  @@_ran_once = true
end