Class: Purdie::License
- Inherits:
-
Object
- Object
- Purdie::License
- Defined in:
- lib/purdie/license_manager.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(service, raw_name, values) ⇒ License
constructor
A new instance of License.
- #method_missing(method_name, *args) ⇒ Object
Constructor Details
#initialize(service, raw_name, values) ⇒ License
Returns a new instance of License.
11 12 13 14 |
# File 'lib/purdie/license_manager.rb', line 11 def initialize service, raw_name, values raise LicenseException.new service, raw_name unless values @values = values end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/purdie/license_manager.rb', line 20 def method_missing method_name, *args mname = method_name.to_s if @values.include? mname @values[mname] else raise NoMethodError end end |
Instance Method Details
#[](key) ⇒ Object
16 17 18 |
# File 'lib/purdie/license_manager.rb', line 16 def [] key @values[key] end |