Class: Sendly::PhoneNumber
- Inherits:
-
Object
- Object
- Sendly::PhoneNumber
- Defined in:
- lib/sendly/numbers_resource.rb
Overview
A number owned by the account.
Instance Attribute Summary collapse
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#monthly_cost_cents ⇒ Object
readonly
Returns the value of attribute monthly_cost_cents.
-
#phone_number ⇒ Object
readonly
Returns the value of attribute phone_number.
-
#phone_number_type ⇒ Object
readonly
Returns the value of attribute phone_number_type.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(data) ⇒ PhoneNumber
constructor
A new instance of PhoneNumber.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ PhoneNumber
Returns a new instance of PhoneNumber.
47 48 49 50 51 52 53 54 55 |
# File 'lib/sendly/numbers_resource.rb', line 47 def initialize(data) @id = data["id"] @phone_number = data["phoneNumber"] || data["phone_number"] @status = data["status"] @source = data["source"] @country_code = data["countryCode"] || data["country_code"] @phone_number_type = data["phoneNumberType"] || data["phone_number_type"] @monthly_cost_cents = data["monthlyCostCents"] || data["monthly_cost_cents"] end |
Instance Attribute Details
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
44 45 46 |
# File 'lib/sendly/numbers_resource.rb', line 44 def country_code @country_code end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
44 45 46 |
# File 'lib/sendly/numbers_resource.rb', line 44 def id @id end |
#monthly_cost_cents ⇒ Object (readonly)
Returns the value of attribute monthly_cost_cents.
44 45 46 |
# File 'lib/sendly/numbers_resource.rb', line 44 def monthly_cost_cents @monthly_cost_cents end |
#phone_number ⇒ Object (readonly)
Returns the value of attribute phone_number.
44 45 46 |
# File 'lib/sendly/numbers_resource.rb', line 44 def phone_number @phone_number end |
#phone_number_type ⇒ Object (readonly)
Returns the value of attribute phone_number_type.
44 45 46 |
# File 'lib/sendly/numbers_resource.rb', line 44 def phone_number_type @phone_number_type end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
44 45 46 |
# File 'lib/sendly/numbers_resource.rb', line 44 def source @source end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
44 45 46 |
# File 'lib/sendly/numbers_resource.rb', line 44 def status @status end |
Instance Method Details
#to_h ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/sendly/numbers_resource.rb', line 57 def to_h { id: id, phone_number: phone_number, status: status, source: source, country_code: country_code, phone_number_type: phone_number_type, monthly_cost_cents: monthly_cost_cents }.compact end |