Class: CouchProxy::Partition
- Inherits:
-
Object
- Object
- CouchProxy::Partition
- Defined in:
- lib/couchproxy/partition.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#num ⇒ Object
readonly
Returns the value of attribute num.
Instance Method Summary collapse
-
#initialize(node, num) ⇒ Partition
constructor
A new instance of Partition.
- #uri(db) ⇒ Object
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
#node ⇒ Object (readonly)
Returns the value of attribute node.
5 6 7 |
# File 'lib/couchproxy/partition.rb', line 5 def node @node end |
#num ⇒ Object (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 |