Class: WordstreamClient::Config
- Inherits:
-
Object
- Object
- WordstreamClient::Config
- Defined in:
- lib/wordstream_client/config.rb
Class Attribute Summary collapse
-
.password ⇒ Object
Returns the value of attribute password.
-
.session_id ⇒ Object
Returns the value of attribute session_id.
-
.username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
- .client ⇒ Object
-
.instantiate ⇒ Object
Instantiate new instance.
Instance Method Summary collapse
- #default_host ⇒ Object
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #password ⇒ Object
- #session_id ⇒ Object
- #session_id=(new_session) ⇒ Object
- #username ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
20 21 22 23 24 |
# File 'lib/wordstream_client/config.rb', line 20 def initialize( = {}) [:username, :password, :session_id].each do |var| instance_variable_set "@#{var}", [var] end end |
Class Attribute Details
.password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/wordstream_client/config.rb', line 6 def password @password end |
.session_id ⇒ Object
Returns the value of attribute session_id.
6 7 8 |
# File 'lib/wordstream_client/config.rb', line 6 def session_id @session_id end |
.username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/wordstream_client/config.rb', line 6 def username @username end |
Class Method Details
.client ⇒ Object
16 17 18 |
# File 'lib/wordstream_client/config.rb', line 16 def self.client Client.new instantiate end |
.instantiate ⇒ Object
Instantiate new instance
12 13 14 |
# File 'lib/wordstream_client/config.rb', line 12 def self.instantiate new( :username => username, :password => password, :session_id => session_id ) end |
Instance Method Details
#default_host ⇒ Object
43 44 45 |
# File 'lib/wordstream_client/config.rb', line 43 def default_host 'http://api.wordstream.com' end |
#password ⇒ Object
30 31 32 |
# File 'lib/wordstream_client/config.rb', line 30 def password @password end |
#session_id ⇒ Object
34 35 36 |
# File 'lib/wordstream_client/config.rb', line 34 def session_id @session_id end |
#session_id=(new_session) ⇒ Object
38 39 40 41 |
# File 'lib/wordstream_client/config.rb', line 38 def session_id=(new_session) instance_variable_set "@session_id", new_session self.class.session_id = new_session end |
#username ⇒ Object
26 27 28 |
# File 'lib/wordstream_client/config.rb', line 26 def username @username end |