Class: Marshalsea::Psych::Document
- Inherits:
-
Object
- Object
- Marshalsea::Psych::Document
- Defined in:
- lib/marshalsea/psych/inspector.rb
Instance Attribute Summary collapse
-
#alias_count ⇒ Object
readonly
Returns the value of attribute alias_count.
-
#document_count ⇒ Object
readonly
Returns the value of attribute document_count.
-
#node_count ⇒ Object
readonly
Returns the value of attribute node_count.
-
#references ⇒ Object
readonly
Returns the value of attribute references.
Instance Method Summary collapse
- #class_names ⇒ Object
- #gated_references ⇒ Object
-
#initialize(references:, alias_count:, node_count:, document_count:) ⇒ Document
constructor
A new instance of Document.
- #key_position_references ⇒ Object
- #revivable ⇒ Object
Constructor Details
#initialize(references:, alias_count:, node_count:, document_count:) ⇒ Document
Returns a new instance of Document.
105 106 107 108 109 110 |
# File 'lib/marshalsea/psych/inspector.rb', line 105 def initialize(references:, alias_count:, node_count:, document_count:) @references = references @alias_count = alias_count @node_count = node_count @document_count = document_count end |
Instance Attribute Details
#alias_count ⇒ Object (readonly)
Returns the value of attribute alias_count.
103 104 105 |
# File 'lib/marshalsea/psych/inspector.rb', line 103 def alias_count @alias_count end |
#document_count ⇒ Object (readonly)
Returns the value of attribute document_count.
103 104 105 |
# File 'lib/marshalsea/psych/inspector.rb', line 103 def document_count @document_count end |
#node_count ⇒ Object (readonly)
Returns the value of attribute node_count.
103 104 105 |
# File 'lib/marshalsea/psych/inspector.rb', line 103 def node_count @node_count end |
#references ⇒ Object (readonly)
Returns the value of attribute references.
103 104 105 |
# File 'lib/marshalsea/psych/inspector.rb', line 103 def references @references end |
Instance Method Details
#class_names ⇒ Object
112 113 114 |
# File 'lib/marshalsea/psych/inspector.rb', line 112 def class_names references.filter_map(&:class_name).uniq end |
#gated_references ⇒ Object
124 125 126 |
# File 'lib/marshalsea/psych/inspector.rb', line 124 def gated_references references.select(&:gated?) end |
#key_position_references ⇒ Object
120 121 122 |
# File 'lib/marshalsea/psych/inspector.rb', line 120 def key_position_references references.select(&:key_position?) end |
#revivable ⇒ Object
116 117 118 |
# File 'lib/marshalsea/psych/inspector.rb', line 116 def revivable references.reject { |reference| reference.class_name.nil? } end |