Class: Onion::CircuitList
- Inherits:
-
Object
- Object
- Onion::CircuitList
- Defined in:
- lib/onion/elements/circuit_list.rb
Overview
Onion::CircuitList is a list of Onion::Circuit objects.
Instance Attribute Summary collapse
-
#circuits ⇒ Object
readonly
Returns the value of attribute circuits.
Instance Method Summary collapse
-
#initialize(text) ⇒ CircuitList
constructor
A new instance of CircuitList.
Constructor Details
#initialize(text) ⇒ CircuitList
Returns a new instance of CircuitList.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/onion/elements/circuit_list.rb', line 5 def initialize(text) if text.blank? @circuits = [] return self end parser = Onion::CircuitListsParser.new if nodes = parser.parse(text) @circuits = nodes.circuits else raise Exception, "Couldn't parse #{text} b/c #{parser.failure_reason}." end end |
Instance Attribute Details
#circuits ⇒ Object (readonly)
Returns the value of attribute circuits.
4 5 6 |
# File 'lib/onion/elements/circuit_list.rb', line 4 def circuits @circuits end |