Class: CouchProxy::Partition

Inherits:
Object
  • Object
show all
Defined in:
lib/couchproxy/partition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node, num) ⇒ Partition

Returns a new instance of Partition.



7
8
9
# File 'lib/couchproxy/partition.rb', line 7

def initialize(node, num)
  @node, @num = node, num
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



5
6
7
# File 'lib/couchproxy/partition.rb', line 5

def node
  @node
end

#numObject (readonly)

Returns the value of attribute num.



5
6
7
# File 'lib/couchproxy/partition.rb', line 5

def num
  @num
end

Instance Method Details

#uri(db) ⇒ Object



11
12
13
# File 'lib/couchproxy/partition.rb', line 11

def uri(db)
  "#{@node.uri.chomp('/')}/#{db}_#{@num}"
end