Class: Konacha::Reporter::ExampleGroup
- Inherits:
-
Object
- Object
- Konacha::Reporter::ExampleGroup
- Defined in:
- lib/konacha/reporter/example_group.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#parent ⇒ Object
(also: #example_group)
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(data, parent) ⇒ ExampleGroup
constructor
A new instance of ExampleGroup.
- #parent_groups ⇒ Object (also: #ancestors)
- #update_metadata(data) ⇒ Object
Constructor Details
#initialize(data, parent) ⇒ ExampleGroup
Returns a new instance of ExampleGroup.
10 11 12 13 14 15 16 |
# File 'lib/konacha/reporter/example_group.rb', line 10 def initialize(data, parent) @metadata = Metadata.new(data) @parent = parent if parent (example_group: parent.) end end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
8 9 10 |
# File 'lib/konacha/reporter/example_group.rb', line 8 def @metadata end |
#parent ⇒ Object (readonly) Also known as: example_group
Returns the value of attribute parent.
8 9 10 |
# File 'lib/konacha/reporter/example_group.rb', line 8 def parent @parent end |
Instance Method Details
#[](key) ⇒ Object
40 41 42 |
# File 'lib/konacha/reporter/example_group.rb', line 40 def [](key) respond_to?(key) ? send(key) : [key] end |
#parent_groups ⇒ Object Also known as: ancestors
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/konacha/reporter/example_group.rb', line 23 def parent_groups ancestor = parent groups = [] while ancestor groups << ancestor ancestor = ancestor.parent end groups end |
#update_metadata(data) ⇒ Object
36 37 38 |
# File 'lib/konacha/reporter/example_group.rb', line 36 def (data) .update(data) end |