Class: CDEKApiClient::Entities::Sender
- Inherits:
-
Object
- Object
- CDEKApiClient::Entities::Sender
- Includes:
- Validatable
- Defined in:
- lib/cdek_api_client/entities/sender.rb
Overview
Represents a sender entity in the CDEK API. Each sender includes attributes such as name, phones, and email.
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phones ⇒ Object
Returns the value of attribute phones.
Instance Method Summary collapse
-
#initialize(name:, phones:, email:) ⇒ Sender
constructor
Initializes a new Sender object.
-
#to_json(*_args) ⇒ String
Converts the Sender object to a JSON representation.
Methods included from Validatable
Constructor Details
#initialize(name:, phones:, email:) ⇒ Sender
Initializes a new Sender object.
25 26 27 28 29 30 |
# File 'lib/cdek_api_client/entities/sender.rb', line 25 def initialize(name:, phones:, email:) @name = name @phones = phones @email = email validate! end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
12 13 14 |
# File 'lib/cdek_api_client/entities/sender.rb', line 12 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/cdek_api_client/entities/sender.rb', line 12 def name @name end |
#phones ⇒ Object
Returns the value of attribute phones.
12 13 14 |
# File 'lib/cdek_api_client/entities/sender.rb', line 12 def phones @phones end |
Instance Method Details
#to_json(*_args) ⇒ String
Converts the Sender object to a JSON representation.
35 36 37 38 39 40 41 |
# File 'lib/cdek_api_client/entities/sender.rb', line 35 def to_json(*_args) { name: @name, phones: @phones, email: @email }.to_json end |