Class: Mutant::Usage Private

Inherits:
Object
  • Object
show all
Includes:
Unparser::Adamantium
Defined in:
lib/mutant/usage.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

Commercial, Opensource, Unknown

Defined Under Namespace

Classes: Commercial, Opensource, Unknown

Constant Summary collapse

CLI_REGEXP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/\A(?:commercial|opensource)\z/
TRANSFORM =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Transform::Sequence.new(
  steps: [
    Transform::STRING,
    Transform::Block.capture(:environment_variables, &method(:parse))
  ]
)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



93
94
95
96
97
98
# File 'lib/mutant/usage.rb', line 93

def self.parse(value)
  {
    'commercial' => Either::Right.new(Commercial.new),
    'opensource' => Either::Right.new(Opensource.new)
  }.fetch(value) { Either::Left.new("Unknown usage option: #{value.inspect}") }
end

Instance Method Details

#merge(_other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
# File 'lib/mutant/usage.rb', line 19

def merge(_other)
  self
end

#messageObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
# File 'lib/mutant/usage.rb', line 15

def message
  self.class::MESSAGE
end

#valueObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/mutant/usage.rb', line 7

def value
  self.class::VALUE
end

#verifyObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/mutant/usage.rb', line 11

def verify
  Either::Right.new(nil)
end