Class: Mutant::License::Subscription Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mutant/license/subscription.rb,
lib/mutant/license/subscription/commercial.rb,
lib/mutant/license/subscription/opensource.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

Defined Under Namespace

Classes: Commercial, Opensource

Constant Summary collapse

FORMAT =

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.

<<~'MESSAGE'
  %<subscription_name>s subscription:
  Licensed:
  %<licensed>s
MESSAGE
FAILURE_FORMAT =

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.

<<~'MESSAGE'
  Can not validate %<subscription_name>s license.
  Licensed:
  %<expected>s
  Present:
  %<actual>s
MESSAGE

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load(world, value) ⇒ Subscription

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.

Load value into subscription

Parameters:

  • value (Object)

Returns:



27
28
29
30
31
32
33
34
# File 'lib/mutant/license/subscription.rb', line 27

def self.load(world, value)
  {
    'com' => Commercial,
    'oss' => Opensource
  }.fetch(value.fetch('type'))
    .from_json(value.fetch('contents'))
    .call(world)
end

Instance Method Details

#descriptionString

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.

Subscription self description

Returns:

  • (String)


39
40
41
42
43
44
# File 'lib/mutant/license/subscription.rb', line 39

def description
  FORMAT % {
    licensed:          licensed.to_a.join("\n"),
    subscription_name: subscription_name
  }
end