Hi all,
I am storing an array of objects within another object, but am not
sure how to print the values of the array out. When I do an
Port.inspect, it gives me something like this:
#<Port:0x4021de58 @state=[#<State:0x4021dca0 @state="1">,
#<State:0x4021d8f4 @state="2">], @protocol="tcp",
@owner=[#<Owner:0x4021d9a8 @name="11">, #<Owner:0x4021d854
@name="12">>
But when I do a Port.print_port, defined as
def print_port
"Port: #{@protocol}, #{@state}, #{@owner} "
end
it prints:
Port: tcp, #<State:0x4021dcc8>#<State:0x4021d8cc>,
#<Owner:0x4021d9d0>#<Owner:0x4021d82c>
So, How do I address the object with the ID of #<State:0x4021dcc8>,
and print out its constituent values?
thanks for any help.
Dan