Sha256: 4a5560cb49126a98981dbe1dc62cdecea0476034b8564e2efcf806667ba58574

Contents?: true

Size: 535 Bytes

Versions: 2

Compression:

Stored size: 535 Bytes

Contents

module Easee
  class Site
    def initialize(data)
      @data = data.deep_symbolize_keys
    end

    def name = @data.fetch(:name)
    def street = address.fetch(:street)
    def building_number = address.fetch(:buildingNumber)
    def zip = address.fetch(:zip)
    def area = address.fetch(:area)
    def country_id = address.fetch(:country).fetch(:id)
    def latitude = address.fetch(:latitude)
    def longitude = address.fetch(:longitude)

    private

    def address
      @address ||= @data.fetch(:address)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stekker_easee-1.0.0 lib/easee/site.rb
stekker_easee-0.1.0 lib/easee/site.rb