Class: Zresume::Box

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

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *a) ⇒ Object

Raises:

  • (Exception)


3
4
5
6
7
# File 'lib/zresume/box.rb', line 3

def method_missing(m, *a)
    t = select {|a| a.title.to_s == m.to_s }
    raise Exception, "There is no Item named `#{m}`." if t.empty?
    return t[0] if t.length == 1
end