Class: Company::Customer
- Defined in:
- lib/company/resources/customer.rb
Overview
A person the business works for.
Class Method Summary collapse
-
.attributes ⇒ Object
What every customer reads, by the vocabulary's names.
Instance Method Summary collapse
-
#email ⇒ String?
Address they are written to.
-
#name ⇒ String?
What they go by: a given name, or a business's where a person has none.
-
#phone ⇒ String?
Ten digits they are reached on, nil where none can be dialed.
-
#surname ⇒ String?
Their surname.
Methods inherited from Resource
#id, #initialize, keys, node_keys
Constructor Details
This class inherits a constructor from Company::Resource
Class Method Details
.attributes ⇒ Object
What every customer reads, by the vocabulary's names.
5 |
# File 'lib/company/resources/customer.rb', line 5 def self.attributes = %i[id name surname email phone] |
Instance Method Details
#email ⇒ String?
Returns address they are written to.
14 |
# File 'lib/company/resources/customer.rb', line 14 def email = attribute :email |
#name ⇒ String?
Returns what they go by: a given name, or a business's where a person has none.
8 |
# File 'lib/company/resources/customer.rb', line 8 def name = attribute :name |
#phone ⇒ String?
Returns ten digits they are reached on, nil where none can be dialed.
17 |
# File 'lib/company/resources/customer.rb', line 17 def phone = Phone.from attribute(:phone) |
#surname ⇒ String?
Returns their surname.
11 |
# File 'lib/company/resources/customer.rb', line 11 def surname = attribute :surname |