Class: ThreeScaleToolbox::Commands::PlansCommand::Apply::CustomPrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/3scale_toolbox/commands/plans_command/apply_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CustomPrinter

Returns a new instance of CustomPrinter.



9
10
11
12
13
14
15
# File 'lib/3scale_toolbox/commands/plans_command/apply_command.rb', line 9

def initialize(options)
  @option_default = options[:default]
  @option_disabled = options[:disabled]
  @option_enabled = options[:enabled]
  @option_publish = options[:publish]
  @option_hide = options[:hide]
end

Instance Attribute Details

#option_defaultObject (readonly)

Returns the value of attribute option_default.



6
7
8
# File 'lib/3scale_toolbox/commands/plans_command/apply_command.rb', line 6

def option_default
  @option_default
end

#option_disabledObject (readonly)

Returns the value of attribute option_disabled.



6
7
8
# File 'lib/3scale_toolbox/commands/plans_command/apply_command.rb', line 6

def option_disabled
  @option_disabled
end

#option_enabledObject (readonly)

Returns the value of attribute option_enabled.



6
7
8
# File 'lib/3scale_toolbox/commands/plans_command/apply_command.rb', line 6

def option_enabled
  @option_enabled
end

#option_hideObject (readonly)

Returns the value of attribute option_hide.



6
7
8
# File 'lib/3scale_toolbox/commands/plans_command/apply_command.rb', line 6

def option_hide
  @option_hide
end

#option_publishObject (readonly)

Returns the value of attribute option_publish.



6
7
8
# File 'lib/3scale_toolbox/commands/plans_command/apply_command.rb', line 6

def option_publish
  @option_publish
end

Instance Method Details



27
# File 'lib/3scale_toolbox/commands/plans_command/apply_command.rb', line 27

def print_collection(collection) end


17
18
19
20
21
22
23
24
25
# File 'lib/3scale_toolbox/commands/plans_command/apply_command.rb', line 17

def print_record(plan)
  output_msg_array = ["Applied application plan id: #{plan['id']}"]
  output_msg_array << "Default: #{option_default}"
  output_msg_array << 'Disabled' if option_disabled
  output_msg_array << 'Enabled' if option_enabled
  output_msg_array << 'Published' if option_publish
  output_msg_array << 'Hidden' if option_hide
  puts output_msg_array.join('; ')
end