Class: Conjur::Policy::YAML::Handler::Root
- Defined in:
- lib/conjur/policy/yaml/handler.rb
Overview
Handles the root document, which should be a sequence.
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Attributes inherited from Base
Instance Method Summary collapse
-
#end_sequence ⇒ Object
Finish the sequence, and the document.
-
#initialize(handler) ⇒ Root
constructor
A new instance of Root.
- #sequence(seq) ⇒ Object
-
#start_sequence(anchor) ⇒ Object
The document root is expected to start with a sequence.
Methods inherited from Base
#alias, #end_mapping, #pop_handler, #push_handler, #scalar, #start_mapping
Constructor Details
#initialize(handler) ⇒ Root
Returns a new instance of Root.
99 100 101 102 103 104 |
# File 'lib/conjur/policy/yaml/handler.rb', line 99 def initialize handler super nil, nil @handler = handler @result = nil end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
97 98 99 |
# File 'lib/conjur/policy/yaml/handler.rb', line 97 def handler @handler end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
97 98 99 |
# File 'lib/conjur/policy/yaml/handler.rb', line 97 def result @result end |
Instance Method Details
#end_sequence ⇒ Object
Finish the sequence, and the document.
123 124 125 |
# File 'lib/conjur/policy/yaml/handler.rb', line 123 def end_sequence pop_handler end |
#sequence(seq) ⇒ Object
108 109 110 111 |
# File 'lib/conjur/policy/yaml/handler.rb', line 108 def sequence seq raise "Already got sequence result" if @result @result = seq end |
#start_sequence(anchor) ⇒ Object
The document root is expected to start with a sequence. A Sequence handler is constructed with no implicit type. This sub-handler handles the message.
116 117 118 119 120 |
# File 'lib/conjur/policy/yaml/handler.rb', line 116 def start_sequence anchor Sequence.new(self, anchor, nil).tap do |h| h.push_handler end end |