Class: Chamber::Commands::Show

Inherits:
Base
  • Object
show all
Defined in:
lib/chamber/commands/show.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#chamber, #dry_run, #rootpath, #shell

Instance Method Summary collapse

Methods inherited from Base

call

Constructor Details

#initialize(as_env: nil, only_sensitive: nil, **args) ⇒ Show

Returns a new instance of Show.



12
13
14
15
16
17
# File 'lib/chamber/commands/show.rb', line 12

def initialize(as_env: nil, only_sensitive: nil, **args)
  super(**args)

  self.as_env         = as_env
  self.only_sensitive = only_sensitive
end

Instance Attribute Details

#as_envObject

Returns the value of attribute as_env.



9
10
11
# File 'lib/chamber/commands/show.rb', line 9

def as_env
  @as_env
end

#only_sensitiveObject

Returns the value of attribute only_sensitive.



9
10
11
# File 'lib/chamber/commands/show.rb', line 9

def only_sensitive
  @only_sensitive
end

Instance Method Details

#callObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/chamber/commands/show.rb', line 19

def call
  if as_env
    settings.to_s(pair_separator: "\n")
  else
    PP
      .pp(settings.to_hash, StringIO.new, 60)
      .string
      .chomp
  end
end