Class: Harvest::Base
Direct Known Subclasses
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#email ⇒ Object
Returns the value of attribute email.
-
#password ⇒ Object
Returns the value of attribute password.
-
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #rate_limit_status ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 15 16 17 |
# File 'lib/harvest/base.rb', line 9 def initialize(={}) @domain = [:domain] ||= Harvest.domain @email = [:email] ||= Harvest.email @password = [:password] ||= Harvest.password @use_ssl = [:use_ssl] ||= Harvest.use_ssl self.class.base_uri "#{@domain}.harvestapp.com" self.class.basic_auth(@email, @password) end |
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
7 8 9 |
# File 'lib/harvest/base.rb', line 7 def domain @domain end |
#email ⇒ Object
Returns the value of attribute email.
7 8 9 |
# File 'lib/harvest/base.rb', line 7 def email @email end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/harvest/base.rb', line 7 def password @password end |
#use_ssl ⇒ Object
Returns the value of attribute use_ssl.
7 8 9 |
# File 'lib/harvest/base.rb', line 7 def use_ssl @use_ssl end |
Instance Method Details
#rate_limit_status ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/harvest/base.rb', line 19 def rate_limit_status request = Mash.new(self.class.get('/account/rate_limit_status')).request %w(count time_frame_limit max_calls lockout_seconds).each do |key| request[key] = request[key].to_i end request end |