Class: Lacuna::Extras::Body

Inherits:
Module
  • Object
show all
Defined in:
lib/lacuna/extras/body.rb

Direct Known Subclasses

Body

Class Method Summary collapse

Methods inherited from Module

method_missing, send, session_stuff

Class Method Details

.find_building(buildings, name) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/lacuna/extras/body.rb', line 6

def self.find_building(buildings, name)
    building = buildings.select do |id, building|
        # Save the id for later
        buildings[id]['id'] = id
        building['name'] == name
    end
    # Grab the first item in the hash.
    building = building[building.keys[0]]
    building
end