Class: FootStats::Setup

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/foot_stats/setup.rb

Overview

Class responsible to handle all the FootStats setup.

Examples:


FootStats::Setup.setup do |config|
  config.username      = "foo"
  config.password      = "bar"
  config.logger        = Rails.logger
  config.base_url      = "http://footstats.com.br/modyo.asmx/"
  config.payload_store = Redis.new
end

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#base_urlObject

Returns the value of attribute base_url.



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

def base_url
  @base_url
end

#loggerObject

Returns the value of attribute logger.



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

def logger
  @logger
end

#passwordObject

Returns the value of attribute password.



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

def password
  @password
end

#payload_storeObject

Returns the value of attribute payload_store.



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

def payload_store
  @payload_store
end

#usernameObject

Returns the value of attribute username.



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

def username
  @username
end

Class Method Details

.method_missing(method_name, *args, &block) ⇒ Object



26
27
28
# File 'lib/foot_stats/setup.rb', line 26

def self.method_missing(method_name, *args, &block)
  instance.send method_name, *args, &block
end

.setup {|instance| ... } ⇒ Object

Parameters:

  • block (Proc)

Yields:

  • (instance)


21
22
23
24
# File 'lib/foot_stats/setup.rb', line 21

def self.setup
  instance.payload_store = Hash.new
  yield(instance) if block_given?
end