Class: Ratis::Landmark
- Inherits:
-
Object
- Object
- Ratis::Landmark
- Defined in:
- lib/ratis/landmark.rb
Instance Attribute Summary collapse
-
#locality ⇒ Object
Returns the value of attribute locality.
-
#location ⇒ Object
Returns the value of attribute location.
-
#type ⇒ Object
Returns the value of attribute type.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Class Method Summary collapse
Instance Attribute Details
#locality ⇒ Object
Returns the value of attribute locality.
5 6 7 |
# File 'lib/ratis/landmark.rb', line 5 def locality @locality end |
#location ⇒ Object
Returns the value of attribute location.
5 6 7 |
# File 'lib/ratis/landmark.rb', line 5 def location @location end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/ratis/landmark.rb', line 5 def type @type end |
#verbose ⇒ Object
Returns the value of attribute verbose.
5 6 7 |
# File 'lib/ratis/landmark.rb', line 5 def verbose @verbose end |
Class Method Details
.where(conditions) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ratis/landmark.rb', line 7 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 |