Class: Aptible::CLI::Formatter::KeyedList

Inherits:
List
  • Object
show all
Defined in:
lib/aptible/cli/formatter/keyed_list.rb

Direct Known Subclasses

GroupedKeyedList

Instance Attribute Summary collapse

Attributes inherited from List

#children

Instance Method Summary collapse

Methods inherited from List

#object

Constructor Details

#initialize(key) ⇒ KeyedList

Returns a new instance of KeyedList.



10
11
12
13
# File 'lib/aptible/cli/formatter/keyed_list.rb', line 10

def initialize(key)
  @key = key
  super()
end

Instance Attribute Details

#keyObject (readonly)

KeyedList is a list of objects with one key that is more important than the others. Some renderers may opt to only display this key when rendering the list.



8
9
10
# File 'lib/aptible/cli/formatter/keyed_list.rb', line 8

def key
  @key
end

Instance Method Details

#listObject



19
20
21
# File 'lib/aptible/cli/formatter/keyed_list.rb', line 19

def list
  raise "not supported on #{self.class}"
end

#value(_) ⇒ Object



15
16
17
# File 'lib/aptible/cli/formatter/keyed_list.rb', line 15

def value(_)
  raise "not supported on #{self.class}"
end