Class: CDEKApiClient::Entities::IntakeAvailableDaysRequest
- Inherits:
-
Object
- Object
- CDEKApiClient::Entities::IntakeAvailableDaysRequest
- Includes:
- Validatable
- Defined in:
- lib/cdek_api_client/entities/intake_available_days_request.rb
Overview
Represents a request for available courier intake days from the CDEK API.
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#from_location ⇒ Object
Returns the value of attribute from_location.
Instance Method Summary collapse
-
#initialize(from_location:, date: nil) ⇒ IntakeAvailableDaysRequest
constructor
Initializes a new IntakeAvailableDaysRequest object.
-
#to_json(*_args) ⇒ String
Converts the IntakeAvailableDaysRequest object to a JSON representation.
Methods included from Validatable
Constructor Details
#initialize(from_location:, date: nil) ⇒ IntakeAvailableDaysRequest
Initializes a new IntakeAvailableDaysRequest object.
21 22 23 24 25 |
# File 'lib/cdek_api_client/entities/intake_available_days_request.rb', line 21 def initialize(from_location:, date: nil) @from_location = from_location @date = date validate! end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
11 12 13 |
# File 'lib/cdek_api_client/entities/intake_available_days_request.rb', line 11 def date @date end |
#from_location ⇒ Object
Returns the value of attribute from_location.
11 12 13 |
# File 'lib/cdek_api_client/entities/intake_available_days_request.rb', line 11 def from_location @from_location end |
Instance Method Details
#to_json(*_args) ⇒ String
Converts the IntakeAvailableDaysRequest object to a JSON representation.
30 31 32 33 34 |
# File 'lib/cdek_api_client/entities/intake_available_days_request.rb', line 30 def to_json(*_args) data = { from_location: @from_location } data[:date] = @date if @date data.to_json end |