Class: HammerCLI::Options::Normalizers::AbstractNormalizer

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

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.availableObject (readonly)

Returns the value of attribute available.



13
14
15
# File 'lib/hammer_cli/options/normalizers.rb', line 13

def available
  @available
end

Class Method Details

.common_descriptionObject



24
25
26
# File 'lib/hammer_cli/options/normalizers.rb', line 24

def common_description
  _("Value described in the option's description. Mostly simple string")
end

.completion_typeObject



20
21
22
# File 'lib/hammer_cli/options/normalizers.rb', line 20

def completion_type
  :value
end

.inherited(subclass) ⇒ Object



15
16
17
18
# File 'lib/hammer_cli/options/normalizers.rb', line 15

def inherited(subclass)
  @available ||= []
  @available << subclass
end

Instance Method Details

#complete(val) ⇒ Object



37
38
39
# File 'lib/hammer_cli/options/normalizers.rb', line 37

def complete(val)
  []
end

#completion_typeObject



41
42
43
# File 'lib/hammer_cli/options/normalizers.rb', line 41

def completion_type
  { type: self.class.completion_type }
end

#descriptionObject



29
30
31
# File 'lib/hammer_cli/options/normalizers.rb', line 29

def description
  ""
end

#format(val) ⇒ Object

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/hammer_cli/options/normalizers.rb', line 33

def format(val)
  raise NotImplementedError, "Class #{self.class.name} must implement method format."
end