Method: Runo::Set#inspect_items

Defined in:
lib/set/_set.rb

#inspect_items(indent = 0) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/set/_set.rb', line 69

def inspect_items(indent = 0)
  my_action = action.inspect
  my_result = result.is_a?(::Hash) ?
    result.keys.sort.inspect.sub(/\A\[([\w\W]*)\]\z/, '{\1}') :
    result.inspect

  '  ' * indent +
  "<\"#{my[:id]}\" @action=#{my_action} @result=#{my_result}>\n" +
  @item_object.keys.sort.collect {|id|
    item = @item_object[id]
    if item.respond_to? :inspect_items
      item.inspect_items(indent + 1)
    else
      action = item.action.inspect
      result = item.result.inspect
      val    = item.val.inspect
      '  ' * (indent + 1) + "<\"#{id}\" @action=#{action} @result=#{result} @val=#{val}>\n"
    end
  }.join
end