Class: SixSaferpay::Phone
- Inherits:
-
Object
- Object
- SixSaferpay::Phone
- Defined in:
- lib/six_saferpay/models/phone.rb
Instance Attribute Summary collapse
-
#main ⇒ Object
Returns the value of attribute main.
-
#mobile ⇒ Object
Returns the value of attribute mobile.
Instance Method Summary collapse
-
#initialize(main: nil, mobile: nil, work: nil) ⇒ Phone
constructor
A new instance of Phone.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(main: nil, mobile: nil, work: nil) ⇒ Phone
Returns a new instance of Phone.
10 11 12 13 14 15 16 17 18 |
# File 'lib/six_saferpay/models/phone.rb', line 10 def initialize( main: nil, mobile: nil, work: nil ) @main = main @mobile = mobile @work = work end |
Instance Attribute Details
#main ⇒ Object
Returns the value of attribute main.
4 5 6 |
# File 'lib/six_saferpay/models/phone.rb', line 4 def main @main end |
#mobile ⇒ Object
Returns the value of attribute mobile.
4 5 6 |
# File 'lib/six_saferpay/models/phone.rb', line 4 def mobile @mobile end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/six_saferpay/models/phone.rb', line 20 def to_hash hash = Hash.new if @main hash.merge!(main: @main) end if @mobile hash.merge!(mobile: @mobile) end if @work hash.merge!(work: @work) end hash end |