Class: ShopsavvyDataApi::UsagePeriod
- Inherits:
-
Object
- Object
- ShopsavvyDataApi::UsagePeriod
- Defined in:
- lib/shopsavvy_data_api/models.rb
Overview
Current billing period details
Instance Attribute Summary collapse
-
#credits_limit ⇒ Object
readonly
Returns the value of attribute credits_limit.
-
#credits_remaining ⇒ Object
readonly
Returns the value of attribute credits_remaining.
-
#credits_used ⇒ Object
readonly
Returns the value of attribute credits_used.
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#requests_made ⇒ Object
readonly
Returns the value of attribute requests_made.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
Instance Method Summary collapse
-
#initialize(data) ⇒ UsagePeriod
constructor
A new instance of UsagePeriod.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ UsagePeriod
Returns a new instance of UsagePeriod.
293 294 295 296 297 298 299 300 |
# File 'lib/shopsavvy_data_api/models.rb', line 293 def initialize(data) @start_date = data["start_date"] @end_date = data["end_date"] @credits_used = data["credits_used"].to_i @credits_limit = data["credits_limit"].to_i @credits_remaining = data["credits_remaining"].to_i @requests_made = data["requests_made"].to_i end |
Instance Attribute Details
#credits_limit ⇒ Object (readonly)
Returns the value of attribute credits_limit.
290 291 292 |
# File 'lib/shopsavvy_data_api/models.rb', line 290 def credits_limit @credits_limit end |
#credits_remaining ⇒ Object (readonly)
Returns the value of attribute credits_remaining.
290 291 292 |
# File 'lib/shopsavvy_data_api/models.rb', line 290 def credits_remaining @credits_remaining end |
#credits_used ⇒ Object (readonly)
Returns the value of attribute credits_used.
290 291 292 |
# File 'lib/shopsavvy_data_api/models.rb', line 290 def credits_used @credits_used end |
#end_date ⇒ Object (readonly)
Returns the value of attribute end_date.
290 291 292 |
# File 'lib/shopsavvy_data_api/models.rb', line 290 def end_date @end_date end |
#requests_made ⇒ Object (readonly)
Returns the value of attribute requests_made.
290 291 292 |
# File 'lib/shopsavvy_data_api/models.rb', line 290 def requests_made @requests_made end |
#start_date ⇒ Object (readonly)
Returns the value of attribute start_date.
290 291 292 |
# File 'lib/shopsavvy_data_api/models.rb', line 290 def start_date @start_date end |
Instance Method Details
#to_h ⇒ Object
302 303 304 305 306 307 308 309 310 311 |
# File 'lib/shopsavvy_data_api/models.rb', line 302 def to_h { start_date: start_date, end_date: end_date, credits_used: credits_used, credits_limit: credits_limit, credits_remaining: credits_remaining, requests_made: requests_made } end |