Class: HostelifyCollection

Inherits:
Array
  • Object
show all
Defined in:
lib/hostelify/hostelify.rb

Instance Method Summary collapse

Instance Method Details

#descsObject



30
31
32
33
34
# File 'lib/hostelify/hostelify.rb', line 30

def descs
  collect do |i|
    i.description
  end
end

#idsObject

This collection does everything an Array does, plus you can add utility methods like names.



18
19
20
21
22
# File 'lib/hostelify/hostelify.rb', line 18

def ids
  collect do |i|
    i.hostel_id
  end
end

#namesObject



24
25
26
27
28
# File 'lib/hostelify/hostelify.rb', line 24

def names
  collect do |i|
    i.name
  end
end