fix code duplication
This commit is contained in:
@ -71,16 +71,7 @@ module Parfait
|
||||
end
|
||||
|
||||
def inspect
|
||||
ret = "Layout["
|
||||
index = 3
|
||||
while index <= self.get_length
|
||||
item = get(index)
|
||||
ret += item.inspect
|
||||
ret += "," unless index == self.get_length
|
||||
index = index + 1
|
||||
end
|
||||
ret += "]"
|
||||
ret
|
||||
"Layout[#{inspect_from(3)}]"
|
||||
end
|
||||
|
||||
def sof_reference_name
|
||||
|
@ -73,7 +73,7 @@ module Parfait
|
||||
return nil if empty?
|
||||
get(get_length())
|
||||
end
|
||||
|
||||
|
||||
# set the value at index.
|
||||
# Lists start from index 1
|
||||
def set( index , value)
|
||||
@ -164,8 +164,11 @@ module Parfait
|
||||
end
|
||||
|
||||
def inspect
|
||||
inspect_from 1
|
||||
end
|
||||
|
||||
def inspect_from index
|
||||
ret = ""
|
||||
index = 1
|
||||
while index <= self.get_length
|
||||
item = get(index)
|
||||
ret += item.inspect
|
||||
|
Reference in New Issue
Block a user