(Rinda::TemplateEntry::initialize): pull up method. Tabs converted to spaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
seki 2005-09-25 02:56:26 +00:00
parent 159642bc75
commit 14b6275a02
2 changed files with 105 additions and 108 deletions

View File

@ -1,3 +1,8 @@
Sun Sep 25 11:54:11 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/rinda/tuplespace.rb (Rinda::TemplateEntry::initialize): pull
up method. Tabs converted to spaces.
Sun Sep 25 09:34:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> Sun Sep 25 09:34:22 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* parse.y: replaced `foo _((boo))' with `foo(boo)'. * parse.y: replaced `foo _((boo))' with `foo(boo)'.

View File

@ -21,7 +21,7 @@ module Rinda
def initialize(ary, sec=nil) def initialize(ary, sec=nil)
@cancel = false @cancel = false
@ary = make_tuple(ary) @tuple = make_tuple(ary)
@renewer = nil @renewer = nil
renew(sec) renew(sec)
end end
@ -37,7 +37,7 @@ module Rinda
# Return the object which makes up the tuple itself: the Array # Return the object which makes up the tuple itself: the Array
# or Hash. # or Hash.
def value; @ary.value; end def value; @tuple.value; end
def canceled?; @cancel; end def canceled?; @cancel; end
@ -86,16 +86,16 @@ module Rinda
# Accessor method for the tuple. # Accessor method for the tuple.
def [](key) def [](key)
@ary[key] @tuple[key]
end end
def fetch(key) def fetch(key)
@ary.fetch(key) @tuple.fetch(key)
end end
# The size of the tuple. # The size of the tuple.
def size def size
@ary.size @tuple.size
end end
# Create a new tuple from the supplied object (array-like). # Create a new tuple from the supplied object (array-like).
@ -125,19 +125,11 @@ module Rinda
# The same as a TupleEntry but with methods to do matching. # The same as a TupleEntry but with methods to do matching.
# #
class TemplateEntry < TupleEntry class TemplateEntry < TupleEntry
def initialize(ary, expires=nil)
super(ary, expires)
@template = Rinda::Template.new(ary)
end
def match(tuple) def match(tuple)
@template.match(tuple) @tuple.match(tuple)
end end
# An alias for #match. alias === match
def ===(tuple)
match(tuple)
end
# Create a new Template from the supplied object. # Create a new Template from the supplied object.
def make_tuple(ary) def make_tuple(ary)