Sha256: 79a36bf58ab83bd0126ee5b3c12d5c09c155810fe401932e4b245583b60f021f

Contents?: true

Size: 431 Bytes

Versions: 1

Compression:

Stored size: 431 Bytes

Contents

# encoding: utf-8

module Riksteatern
  class Venue
    class Location
      attr_reader :region, :municipality, :latitude, :longitude

      def initialize(data)
        pos = data.fetch('geoPosition', {}).fetch('geoPositionShipping', {})

        @region       = data['regionName']
        @municipality = data['municipalityName']
        @latitude     = pos['lat']
        @longitude    = pos['lon']
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
riksteatern-0.0.1 lib/riksteatern/venue/location.rb