Class: Plivo::Location
- Inherits:
-
Object
- Object
- Plivo::Location
- Defined in:
- lib/plivo/location.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(latitude: nil, longitude: nil, name: nil, address: nil) ⇒ Location
constructor
A new instance of Location.
- #to_hash ⇒ Object
Constructor Details
#initialize(latitude: nil, longitude: nil, name: nil, address: nil) ⇒ Location
Returns a new instance of Location.
5 6 7 8 9 10 |
# File 'lib/plivo/location.rb', line 5 def initialize(latitude: nil, longitude: nil, name: nil, address: nil) @latitude = latitude @longitude = longitude @name = name @address = address end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
3 4 5 |
# File 'lib/plivo/location.rb', line 3 def address @address end |
#latitude ⇒ Object
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/plivo/location.rb', line 3 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
3 4 5 |
# File 'lib/plivo/location.rb', line 3 def longitude @longitude end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/plivo/location.rb', line 3 def name @name end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/plivo/location.rb', line 12 def to_hash { latitude: @latitude, longitude: @longitude, name: @name, address: @address }.reject { |_, v| v.nil? } end |