use include so we can test with is_a

using the well documented included/extend trick
This commit is contained in:
Torsten Ruger
2015-10-25 19:16:12 +02:00
parent 3318b5026c
commit 60098257e9
6 changed files with 171 additions and 143 deletions

View File

@@ -21,7 +21,22 @@
# Together they turn the object into a hash like structure
module Parfait
class Layout < List
class Layout < Object
include Indexed
self.offset(0)
def each
# not sure how to do this with define_method, because of the double block issue.
# probably some clever way around that, but not important
index = 1
while index <= self.get_length
item = get(index)
yield item
index = index + 1
end
self
end
attribute :object_class
def initialize( object_class )