module Trell::Configurable

Constants

OPTIONS_KEYS

Public Class Methods

keys() click to toggle source
# File lib/trell/configurable.rb, line 22
def keys
  @keys ||= OPTIONS_KEYS
end

Public Instance Methods

api_endpoint() click to toggle source
# File lib/trell/configurable.rb, line 31
def api_endpoint
  File.join(@api_endpoint, '')
end
configure() { |self| ... } click to toggle source
# File lib/trell/configurable.rb, line 27
def configure
  yield self
end
reset!() click to toggle source
# File lib/trell/configurable.rb, line 39
def reset!
  @login              = ENV['TRELL_LOGIN']
  @password           = ENV['TRELL_PASSWORD']
  @application_key    = ENV['TRELL_APPLICATION_TOKEN']
  @application_secret = ENV['TRELL_APPLICATION_SECRET']
  @api_endpoint       = ENV['TRELL_API_ENDPOINT'] || 'https://api.trello.com/1/'
  @web_endpoint       = ENV['TRELL_WEB_ENDPOINT'] || 'https://trello.com/'
  @user_agent         = "Trell Ruby Gem #{Trell::VERSION}"
  @media_type         = 'application/json'
  @connection_options = { headers: { accept: media_type, user_agent: user_agent } }
  @proxy              = ENV['TRELL_PROXY']
  @middleware         = Faraday::RackBuilder.new { |builder|
      builder.use Trell::Response::RaiseError
      builder.adapter Faraday.default_adapter
    }
  self
end
Also aliased as: setup
setup()
Alias for: reset!
web_endpoint() click to toggle source
# File lib/trell/configurable.rb, line 35
def web_endpoint
  File.join(@web_endpoint, '')
end

Private Instance Methods

options() click to toggle source
# File lib/trell/configurable.rb, line 60
def options
  Hash[Trell::Configurable.keys.map { |key|
    [key, instance_variable_get(:"@#{key}")]
  }]
end