Class: OO::CheckLicense

Inherits:
Object
  • Object
show all
Defined in:
lib/oo/check_license.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ CheckLicense

Returns a new instance of CheckLicense.



9
10
11
12
13
# File 'lib/oo/check_license.rb', line 9

def initialize(attrs = {})
  @license_key = attrs.fetch(:key)
  @license_keys = attrs.fetch(:in)
  @license = License.new(key: license_key)
end

Instance Attribute Details

#licenseObject (readonly)

Returns the value of attribute license.



3
4
5
# File 'lib/oo/check_license.rb', line 3

def license
  @license
end

#license_keyObject (readonly)

Returns the value of attribute license_key.



3
4
5
# File 'lib/oo/check_license.rb', line 3

def license_key
  @license_key
end

#license_keysObject (readonly)

Returns the value of attribute license_keys.



3
4
5
# File 'lib/oo/check_license.rb', line 3

def license_keys
  @license_keys
end

Class Method Details

.call(attrs = {}) ⇒ Object



5
6
7
# File 'lib/oo/check_license.rb', line 5

def self.call(attrs = {})
  new(attrs).call
end

Instance Method Details

#callObject



15
16
17
# File 'lib/oo/check_license.rb', line 15

def call
  license.masks & license_keys
end