Class: Aptible::CLI::Formatter::Root

Inherits:
Node
  • Object
show all
Defined in:
lib/aptible/cli/formatter/root.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRoot

Returns a new instance of Root.



7
8
9
# File 'lib/aptible/cli/formatter/root.rb', line 7

def initialize
  @root = nil
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



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

def root
  @root
end

Instance Method Details

#grouped_keyed_list(group, key, &block) ⇒ Object



31
32
33
# File 'lib/aptible/cli/formatter/root.rb', line 31

def grouped_keyed_list(group, key, &block)
  assign_root(GroupedKeyedList.new(group, key), &block)
end

#keyed_list(key, &block) ⇒ Object



27
28
29
# File 'lib/aptible/cli/formatter/root.rb', line 27

def keyed_list(key, &block)
  assign_root(KeyedList.new(key), &block)
end

#keyed_object(key, &block) ⇒ Object



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

def keyed_object(key, &block)
  assign_root(KeyedObject.new(key), &block)
end

#list(&block) ⇒ Object



23
24
25
# File 'lib/aptible/cli/formatter/root.rb', line 23

def list(&block)
  assign_root(List.new, &block)
end

#object(&block) ⇒ Object



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

def object(&block)
  assign_root(Object.new, &block)
end

#value(s) ⇒ Object



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

def value(s)
  assign_root(Value.new(s)) {}
end