Module: Trell::Configurable
Constant Summary collapse
- OPTIONS_KEYS =
%i( login password application_key application_token api_endpoint web_endpoint user_agent media_type )
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #reset! ⇒ Object (also: #setup)
Class Method Details
.keys ⇒ Object
17 18 19 |
# File 'lib/trell/configurable.rb', line 17 def keys @keys ||= OPTIONS_KEYS end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
22 23 24 |
# File 'lib/trell/configurable.rb', line 22 def configure yield self end |
#reset! ⇒ Object Also known as: setup
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/trell/configurable.rb', line 26 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' self end |