Class: HammerCLI::BaseDefaultsProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/hammer_cli/defaults_commands.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBaseDefaultsProvider

Returns a new instance of BaseDefaultsProvider.



6
7
8
9
10
# File 'lib/hammer_cli/defaults_commands.rb', line 6

def initialize
  @provider_name = nil
  @supported_defaults = nil
  @description = 'Abstract provider'
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/hammer_cli/defaults_commands.rb', line 4

def description
  @description
end

#provider_nameObject (readonly)

Returns the value of attribute provider_name.



4
5
6
# File 'lib/hammer_cli/defaults_commands.rb', line 4

def provider_name
  @provider_name
end

#supported_defaultsObject (readonly)

Returns the value of attribute supported_defaults.



4
5
6
# File 'lib/hammer_cli/defaults_commands.rb', line 4

def supported_defaults
  @supported_defaults
end

Instance Method Details

#get_defaultsObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/hammer_cli/defaults_commands.rb', line 16

def get_defaults
  raise NotImplementedError
end

#param_supported?(param) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/hammer_cli/defaults_commands.rb', line 12

def param_supported?(param)
  @supported_defaults.nil? || @supported_defaults.any? {|s| s.to_s == param}
end