Class: Group
- Inherits:
-
Object
- Object
- Group
- Defined in:
- lib/audit/lib/benchmark/group.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#children ⇒ Object
Allowed children are Check and Group objects.
-
#description ⇒ Object
readonly
A descriptive string for this group.
-
#id ⇒ Object
readonly
The unique ID by which this group is referenced from other elements.
-
#name ⇒ Object
readonly
A human-readable name for this group.
Instance Method Summary collapse
- #in_report? ⇒ Boolean
-
#initialize(id, name = nil, description = nil) ⇒ Group
constructor
A new instance of Group.
- #to_hash ⇒ Object
Constructor Details
#initialize(id, name = nil, description = nil) ⇒ Group
Returns a new instance of Group.
10 11 12 13 14 15 |
# File 'lib/audit/lib/benchmark/group.rb', line 10 def initialize(id, name = nil, description = nil) @id = id @name = name @description = description @children = [] end |
Instance Attribute Details
#children ⇒ Object
Allowed children are Check and Group objects
8 9 10 |
# File 'lib/audit/lib/benchmark/group.rb', line 8 def children @children end |
#description ⇒ Object (readonly)
A descriptive string for this group
7 8 9 |
# File 'lib/audit/lib/benchmark/group.rb', line 7 def description @description end |
#id ⇒ Object (readonly)
The unique ID by which this group is referenced from other elements
5 6 7 |
# File 'lib/audit/lib/benchmark/group.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
A human-readable name for this group
6 7 8 |
# File 'lib/audit/lib/benchmark/group.rb', line 6 def name @name end |
Instance Method Details
#in_report? ⇒ Boolean
27 28 29 |
# File 'lib/audit/lib/benchmark/group.rb', line 27 def in_report?() true end |
#to_hash ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/audit/lib/benchmark/group.rb', line 17 def to_hash() return { :type => :GROUP, :id => @id, :name => @name, :description => @description, :children => Lazy.new(Lazy.new(@children, :reject) {|x| !x.in_report?}, :map) {|child| Lazy.new(child, :to_hash)} } end |