Class: Hopo::Rater
- Includes:
- Utils::Calculator, Utils::Sorter
- Defined in:
- lib/hopo/rater.rb
Constant Summary collapse
- BASE_URL =
BASE_URL = ‘integral.dev/api’
'https://integral.honestpolicy.com/api'
- API_VERSION =
2
- API_PATH =
'rates'
Instance Attribute Summary collapse
-
#line ⇒ Object
Returns the value of attribute line.
-
#premium_mode ⇒ Object
Returns the value of attribute premium_mode.
-
#sorter ⇒ Object
Returns the value of attribute sorter.
Attributes inherited from API
#default_params, #http, #path, #ssl, #uri, #url
Instance Method Summary collapse
-
#initialize(line, premium_mode = 'annually', sorter = 'premium-asc') ⇒ Rater
constructor
A new instance of Rater.
Methods included from Utils::Sorter
Methods included from Utils::Calculator
Methods inherited from API
Methods included from Connections::Response
Methods included from Connections::Request
#delete, #get, included, #patch, #post, #put
Constructor Details
#initialize(line, premium_mode = 'annually', sorter = 'premium-asc') ⇒ Rater
Returns a new instance of Rater.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/hopo/rater.rb', line 13 def initialize(line, premium_mode='annually', sorter='premium-asc') unless Hopo.api_key raise AuthenticationError, 'No API key provided. Set your API key using "Hopo.api_key = <API-KEY>".' end super(BASE_URL, "/v#{API_VERSION}/#{API_PATH}", true) @premium_mode = premium_mode @sorter = sorter @default_params = { :key => Hopo.api_key, :line => line } end |
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line.
6 7 8 |
# File 'lib/hopo/rater.rb', line 6 def line @line end |
#premium_mode ⇒ Object
Returns the value of attribute premium_mode.
6 7 8 |
# File 'lib/hopo/rater.rb', line 6 def premium_mode @premium_mode end |
#sorter ⇒ Object
Returns the value of attribute sorter.
6 7 8 |
# File 'lib/hopo/rater.rb', line 6 def sorter @sorter end |