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 ⇒ 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.
105 106 107 108 109 110 |
# File 'lib/conjur/policy/yaml/handler.rb', line 105 def initialize handler super nil @handler = handler @result = nil end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
103 104 105 |
# File 'lib/conjur/policy/yaml/handler.rb', line 103 def handler @handler end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
103 104 105 |
# File 'lib/conjur/policy/yaml/handler.rb', line 103 def result @result end |
Instance Method Details
#end_sequence ⇒ Object
Finish the sequence, and the document.
129 130 131 |
# File 'lib/conjur/policy/yaml/handler.rb', line 129 def end_sequence pop_handler end |
#sequence(seq) ⇒ Object
114 115 116 117 |
# File 'lib/conjur/policy/yaml/handler.rb', line 114 def sequence seq raise "Already got sequence result" if @result @result = seq end |
#start_sequence ⇒ 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.
122 123 124 125 126 |
# File 'lib/conjur/policy/yaml/handler.rb', line 122 def start_sequence Sequence.new(self, nil).tap do |h| h.push_handler end.result end |