Class: Aptible::CLI::Formatter::GroupedKeyedList

Inherits:
KeyedList show all
Defined in:
lib/aptible/cli/formatter/grouped_keyed_list.rb

Defined Under Namespace

Classes: InvalidGroup

Instance Attribute Summary collapse

Attributes inherited from KeyedList

#key

Attributes inherited from List

#children

Instance Method Summary collapse

Methods inherited from KeyedList

#list, #value

Methods inherited from List

#list, #object, #value

Constructor Details

#initialize(group, y) ⇒ GroupedKeyedList

Returns a new instance of GroupedKeyedList.



15
16
17
18
19
# File 'lib/aptible/cli/formatter/grouped_keyed_list.rb', line 15

def initialize(group, y)
  @group = group
  validate_group!
  super(y)
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



5
6
7
# File 'lib/aptible/cli/formatter/grouped_keyed_list.rb', line 5

def group
  @group
end

Instance Method Details

#groupsObject



21
22
23
# File 'lib/aptible/cli/formatter/grouped_keyed_list.rb', line 21

def groups
  children.group_by(&grouper)
end