Class: TocDoc::Place

Inherits:
Resource show all
Defined in:
lib/toc_doc/models/place.rb

Overview

Represents a practice location returned inside a profile response.

All fields are accessible via dot-notation inherited from Resource. Nested arrays (+opening_hours+, +stations+) are returned as raw arrays of hashes.

Examples:

place = TocDoc::Place.new(
  'id'               => 'practice-125055',
  'address'          => '1 Rue Anonyme',
  'zipcode'          => '33000',
  'city'             => 'Bordeaux',
  'full_address'     => '1 Rue Anonyme, 33000 Bordeaux',
  'landline_number'  => '05 23 45 67 89',
  'latitude'         => 44.8386722,
  'longitude'        => -0.5780466,
  'elevator'         => true,
  'handicap'         => true,
  'formal_name'      => 'Centre de santé - Anonyme'
)
place.id               #=> "practice-125055"
place.city             #=> "Bordeaux"
place.full_address     #=> "1 Rue Anonyme, 33000 Bordeaux"
place.landline_number  #=> "05 23 45 67 89"
place.latitude         #=> 44.8386722
place.elevator         #=> true

Instance Attribute Summary

Attributes inherited from Resource

#attrs

Instance Method Summary collapse

Methods inherited from Resource

#==, #[], #[]=, #attribute_names, #initialize, #inspect, main_attrs, #method_missing, normalize_attrs, #to_h, #to_json

Constructor Details

This class inherits a constructor from TocDoc::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TocDoc::Resource

Instance Method Details

#coordinatesArray(Float, Float)

Returns the geographic coordinates of the place.

Examples:

place.coordinates  #=> [44.8386722, -0.5780466]

Returns:

  • (Array(Float, Float))

    +[latitude, longitude]+



38
39
40
# File 'lib/toc_doc/models/place.rb', line 38

def coordinates
  [latitude, longitude]
end