Class: WhatsappSdk::Resource::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/whatsapp_sdk/resource/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(latitude:, longitude:, name:, address:) ⇒ Location

Returns a new instance of Location.



27
28
29
30
31
32
# File 'lib/whatsapp_sdk/resource/location.rb', line 27

def initialize(latitude:, longitude:, name:, address:)
  @latitude = latitude
  @longitude = longitude
  @name = name
  @address = address
end

Instance Attribute Details

#addressObject

Returns the address of the location.



25
26
27
# File 'lib/whatsapp_sdk/resource/location.rb', line 25

def address
  @address
end

#latitudeObject

Returns the latitude of the location.



10
11
12
# File 'lib/whatsapp_sdk/resource/location.rb', line 10

def latitude
  @latitude
end

#longitudeObject

Returns the longitude of the location.



15
16
17
# File 'lib/whatsapp_sdk/resource/location.rb', line 15

def longitude
  @longitude
end

#nameObject

Returns the name of the location.



20
21
22
# File 'lib/whatsapp_sdk/resource/location.rb', line 20

def name
  @name
end

Instance Method Details

#to_jsonObject



34
35
36
37
38
39
40
41
# File 'lib/whatsapp_sdk/resource/location.rb', line 34

def to_json
  {
    latitude: latitude,
    longitude: longitude,
    name: name,
    address: address
  }
end