(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:
parent
159642bc75
commit
14b6275a02
@ -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>
|
||||
|
||||
* parse.y: replaced `foo _((boo))' with `foo(boo)'.
|
||||
|
@ -21,7 +21,7 @@ module Rinda
|
||||
|
||||
def initialize(ary, sec=nil)
|
||||
@cancel = false
|
||||
@ary = make_tuple(ary)
|
||||
@tuple = make_tuple(ary)
|
||||
@renewer = nil
|
||||
renew(sec)
|
||||
end
|
||||
@ -37,7 +37,7 @@ module Rinda
|
||||
|
||||
# Return the object which makes up the tuple itself: the Array
|
||||
# or Hash.
|
||||
def value; @ary.value; end
|
||||
def value; @tuple.value; end
|
||||
|
||||
def canceled?; @cancel; end
|
||||
|
||||
@ -86,16 +86,16 @@ module Rinda
|
||||
|
||||
# Accessor method for the tuple.
|
||||
def [](key)
|
||||
@ary[key]
|
||||
@tuple[key]
|
||||
end
|
||||
|
||||
def fetch(key)
|
||||
@ary.fetch(key)
|
||||
@tuple.fetch(key)
|
||||
end
|
||||
|
||||
# The size of the tuple.
|
||||
def size
|
||||
@ary.size
|
||||
@tuple.size
|
||||
end
|
||||
|
||||
# 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.
|
||||
#
|
||||
class TemplateEntry < TupleEntry
|
||||
def initialize(ary, expires=nil)
|
||||
super(ary, expires)
|
||||
@template = Rinda::Template.new(ary)
|
||||
end
|
||||
|
||||
def match(tuple)
|
||||
@template.match(tuple)
|
||||
@tuple.match(tuple)
|
||||
end
|
||||
|
||||
# An alias for #match.
|
||||
def ===(tuple)
|
||||
match(tuple)
|
||||
end
|
||||
alias === match
|
||||
|
||||
# Create a new Template from the supplied object.
|
||||
def make_tuple(ary)
|
||||
|
Loading…
x
Reference in New Issue
Block a user