Sha256: 0c5319f2ba4064f15b65008fad63b572af6a6a2a93a0c32cdad59866892f208b

Contents?: true

Size: 773 Bytes

Versions: 24

Compression:

Stored size: 773 Bytes

Contents

module Ratis

  class Landmark

    attr_accessor :type, :verbose, :location, :locality

    def self.where(conditions)

      type = conditions.delete(:type).to_s.upcase
      raise ArgumentError.new('You must provide a type') if type.blank?
      Ratis.all_conditions_used? conditions

      response = Request.get 'Getlandmarks', {'Type' => type}
      return [] unless response.success?

      response.to_array(:getlandmarks_response, :landmarks, :landmark).map do |landmark|
        atis_landmark = Landmark.new
        atis_landmark.type = landmark[:type]
        atis_landmark.verbose = landmark[:verbose]
        atis_landmark.location = landmark[:location]
        atis_landmark.locality = landmark[:locality]
        atis_landmark
      end

    end

  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ratis-3.3.3 lib/ratis/landmark.rb
ratis-3.3.2 lib/ratis/landmark.rb
ratis-3.3.1 lib/ratis/landmark.rb
ratis-3.3.0 lib/ratis/landmark.rb
ratis-3.2.1 lib/ratis/landmark.rb
ratis-3.2.0 lib/ratis/landmark.rb
ratis-3.1.8 lib/ratis/landmark.rb
ratis-3.1.7 lib/ratis/landmark.rb
ratis-3.1.6 lib/ratis/landmark.rb
ratis-3.1.5.1 lib/ratis/landmark.rb
ratis-3.1.5 lib/ratis/landmark.rb
ratis-3.1.4 lib/ratis/landmark.rb
ratis-3.1.3 lib/ratis/landmark.rb
ratis-3.1.2 lib/ratis/landmark.rb
ratis-3.1.1 lib/ratis/landmark.rb
ratis-3.1.0 lib/ratis/landmark.rb
ratis-3.0.0 lib/ratis/landmark.rb
ratis-2.5.2.8 lib/ratis/landmark.rb
ratis-2.5.2.7 lib/ratis/landmark.rb
ratis-2.5.2.6 lib/ratis/landmark.rb