Class: HammerCLI::Apipie::OptionDefinition

Inherits:
Options::OptionDefinition show all
Defined in:
lib/hammer_cli/apipie/option_definition.rb

Instance Attribute Summary collapse

Attributes inherited from Options::OptionDefinition

#context_target, #deprecated_switches, #family, #value_formatter

Instance Method Summary collapse

Methods inherited from Options::OptionDefinition

#child?, #complete, #completion_type, #default_conversion_block, #default_value, #deprecation_message, #description, #extract_value, #format_description, #format_value, #help_lhs, #help_rhs, #nil_subst, #value_description

Constructor Details

#initialize(switches, type, description, options = {}) ⇒ OptionDefinition

Returns a new instance of OptionDefinition.



7
8
9
10
11
12
13
14
# File 'lib/hammer_cli/apipie/option_definition.rb', line 7

def initialize(switches, type, description, options = {})
  @referenced_resource = options[:referenced_resource].to_s if options[:referenced_resource]
  @aliased_resource = options[:aliased_resource].to_s if options[:aliased_resource]
  super
  # Apipie currently sends descriptions as escaped HTML once this is changed this should be removed.
  # See #15198 on Redmine.
  @description = CGI::unescapeHTML(description)
end

Instance Attribute Details

#aliased_resourceObject

Returns the value of attribute aliased_resource.



5
6
7
# File 'lib/hammer_cli/apipie/option_definition.rb', line 5

def aliased_resource
  @aliased_resource
end

#referenced_resourceObject

Returns the value of attribute referenced_resource.



5
6
7
# File 'lib/hammer_cli/apipie/option_definition.rb', line 5

def referenced_resource
  @referenced_resource
end