Class: Moodle::Api::TokenGenerator
- Inherits:
-
Object
- Object
- Moodle::Api::TokenGenerator
- Defined in:
- lib/moodle/api/token_generator.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(configuration) ⇒ TokenGenerator
constructor
A new instance of TokenGenerator.
Constructor Details
#initialize(configuration) ⇒ TokenGenerator
Returns a new instance of TokenGenerator.
6 7 8 |
# File 'lib/moodle/api/token_generator.rb', line 6 def initialize configuration @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
4 5 6 |
# File 'lib/moodle/api/token_generator.rb', line 4 def configuration @configuration end |
Instance Method Details
#call ⇒ Object
10 11 12 13 |
# File 'lib/moodle/api/token_generator.rb', line 10 def call raise ArgumentError, 'Username and password are required to generate a token' if raise_token_exception? generate_token end |