Class: Aptible::CLI::Formatter::Object

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

Direct Known Subclasses

KeyedObject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Returns a new instance of Object.



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

def initialize
  @children = {}
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



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

def children
  @children
end

Instance Method Details

#keyed_object(k, object_key, &block) ⇒ Object



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

def keyed_object(k, object_key, &block)
  assign_child(k, KeyedObject.new(object_key), &block)
end

#list(k, &block) ⇒ Object



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

def list(k, &block)
  assign_child(k, List.new, &block)
end

#object(k, &block) ⇒ Object



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

def object(k, &block)
  assign_child(k, Object.new, &block)
end

#value(k, v) ⇒ Object



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

def value(k, v)
  assign_child(k, Value.new(v)) {}
end