Class: OO::CheckLicence

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ CheckLicence

Returns a new instance of CheckLicence.



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

def initialize(attrs = {})
  @licence_key = attrs.fetch(:key)
  @licence_keys = attrs.fetch(:in)
  @licence = Licence.new(key: licence_key)
end

Instance Attribute Details

#licenceObject (readonly)

Returns the value of attribute licence.



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

def licence
  @licence
end

#licence_keyObject (readonly)

Returns the value of attribute licence_key.



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

def licence_key
  @licence_key
end

#licence_keysObject (readonly)

Returns the value of attribute licence_keys.



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

def licence_keys
  @licence_keys
end

Class Method Details

.call(attrs = {}) ⇒ Object



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

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

Instance Method Details

#callObject



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

def call
  licence.masks & licence_keys
end