Class: Cockroach::Source::Node
- Inherits:
-
Object
- Object
- Cockroach::Source::Node
- Defined in:
- lib/cockroach/source/node.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(node) ⇒ Node
constructor
A new instance of Node.
-
#sample ⇒ Object
Returns a random record, among generated.
Constructor Details
#initialize(node) ⇒ Node
Returns a new instance of Node.
6 7 8 |
# File 'lib/cockroach/source/node.rb', line 6 def initialize node @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
4 5 6 |
# File 'lib/cockroach/source/node.rb', line 4 def node @node end |
Instance Method Details
#sample ⇒ Object
Returns a random record, among generated.
11 12 13 14 15 |
# File 'lib/cockroach/source/node.rb', line 11 def sample return nil if node.ids.empty? id = node.ids.sample find id end |