Class: OO::CheckLicence
- Inherits:
-
Object
- Object
- OO::CheckLicence
- Defined in:
- lib/oo/check_licence.rb
Instance Attribute Summary collapse
-
#licence ⇒ Object
readonly
Returns the value of attribute licence.
-
#licence_key ⇒ Object
readonly
Returns the value of attribute licence_key.
-
#licence_keys ⇒ Object
readonly
Returns the value of attribute licence_keys.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(attrs = {}) ⇒ CheckLicence
constructor
A new instance of CheckLicence.
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
#licence ⇒ Object (readonly)
Returns the value of attribute licence.
3 4 5 |
# File 'lib/oo/check_licence.rb', line 3 def licence @licence end |
#licence_key ⇒ Object (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_keys ⇒ Object (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
#call ⇒ Object
15 16 17 |
# File 'lib/oo/check_licence.rb', line 15 def call licence.masks & licence_keys end |