Method: BaseChip::Menu#list_line

Defined in:
lib/base_chip/menu.rb

#list_line(string, object) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/base_chip/menu.rb', line 50

def list_line(string,object)
  array = (string.is_a? Array) ? string : [string]

  if self.options.show
    object.configure
    tmp = object
    self.options.show.split(/\./).each do |fun|
      fault("Object of type #{tmp.respond_to?(:class_string) ? tmp.class_string : tmp.class} does not have a data element #{fun.inspect}") unless tmp.respond_to?(fun)
      tmp = tmp.send(fun)
    end
    array << tmp
  end

  if array.size == 1
    puts string
  else
    @table << array
  end
end