Class: GetStream::Generated::Models::SharedLocation

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/shared_location.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#==, #inspect, omit_empty_fields, #to_h, #to_json

Constructor Details

#initialize(attributes = {}) ⇒ SharedLocation

Initialize with attributes



26
27
28
29
30
31
32
# File 'lib/getstream_ruby/generated/models/shared_location.rb', line 26

def initialize(attributes = {})
  super(attributes)
  @latitude = attributes.fetch(:latitude) { attributes.fetch('latitude', nil) }
  @longitude = attributes.fetch(:longitude) { attributes.fetch('longitude', nil) }
  @created_by_device_id = attributes.fetch(:created_by_device_id) { attributes.fetch('created_by_device_id', nil) }
  @end_at = attributes.fetch(:end_at) { attributes.fetch('end_at', nil) }
end

Instance Attribute Details

#created_by_device_id ⇒ String

Returns:

  • (String)


20
21
22
# File 'lib/getstream_ruby/generated/models/shared_location.rb', line 20

def created_by_device_id
  @created_by_device_id
end

#end_at ⇒ DateTime

Returns:

  • (DateTime)


23
24
25
# File 'lib/getstream_ruby/generated/models/shared_location.rb', line 23

def end_at
  @end_at
end

#latitude ⇒ Float

Returns:

  • (Float)


14
15
16
# File 'lib/getstream_ruby/generated/models/shared_location.rb', line 14

def latitude
  @latitude
end

#longitude ⇒ Float

Returns:

  • (Float)


17
18
19
# File 'lib/getstream_ruby/generated/models/shared_location.rb', line 17

def longitude
  @longitude
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



35
36
37
38
39
40
41
42
# File 'lib/getstream_ruby/generated/models/shared_location.rb', line 35

def self.json_field_mappings
  {
    latitude: 'latitude',
    longitude: 'longitude',
    created_by_device_id: 'created_by_device_id',
    end_at: 'end_at'
  }
end