Class: Rdmm::Responses::ListFloorsResponse

Inherits:
BaseResponse show all
Defined in:
lib/rdmm/responses/list_floors_response.rb

Instance Method Summary collapse

Methods inherited from BaseResponse

#body, #each, #first_position, #has_next_page?, #headers, #initialize, #next_page_offset, #result_count, #status, #total_count

Constructor Details

This class inherits a constructor from Rdmm::Responses::BaseResponse

Instance Method Details

#resourcesObject

Note:

Override



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rdmm/responses/list_floors_response.rb', line 5

def resources
  body["result"]["site"].flat_map do |site_source|
    site_source["service"].flat_map do |service_source|
      service_source["floor"].map do |source|
        ::Rdmm::Resources::FloorResource.new(
          source.merge(
            "site_code" => site_source["code"],
            "site_name" => site_source["name"],
            "service_code" => service_source["code"],
            "service_name" => service_source["name"],
          ),
        )
      end
    end
  end
end