Class: Ratis::LandmarkCategory

Inherits:
Object
  • Object
show all
Defined in:
lib/ratis/landmark_category.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/ratis/landmark_category.rb', line 5

def description
  @description
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/ratis/landmark_category.rb', line 5

def type
  @type
end

Class Method Details

.allObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ratis/landmark_category.rb', line 7

def self.all

  response = Request.get 'Getcategories'
  return [] unless response.success?

  response.to_array(:getcategories_response, :types, :typeinfo).map do |typeinfo|
    atis_landmark_category = LandmarkCategory.new
    atis_landmark_category.type = typeinfo[:type]
    atis_landmark_category.description = typeinfo[:description]
    atis_landmark_category
  end
end