Module: Moodle
- Defined in:
- lib/moodle.rb,
lib/moodle/client.rb,
lib/moodle/helper.rb,
lib/moodle/services/user.rb,
lib/moodle/protocols/rest.rb,
lib/moodle/services/cohort.rb,
lib/moodle/services/course.rb,
lib/moodle/services/webservice.rb
Defined Under Namespace
Modules: Protocol, Service Classes: Client, Helper
Constant Summary collapse
- @@config =
{ :username => nil, :password => nil, :token => nil, :protocol => nil, :domain => nil, :service => nil, :format => 'json' }
Class Method Summary collapse
-
.config ⇒ Object
Obtain the global configuration.
-
.configure(options = {}) ⇒ Object
Configure at global level trough hash.
-
.configure_with(path_to_yaml_file) ⇒ Object
Configure at global level through yaml file.
-
.new(options = {}) ⇒ Object
Configuration is for the instance only.
Class Method Details
.config ⇒ Object
Obtain the global configuration
36 37 38 |
# File 'lib/moodle.rb', line 36 def self.config @@config end |
.configure(options = {}) ⇒ Object
Configure at global level trough hash
25 26 27 |
# File 'lib/moodle.rb', line 25 def self.configure(={}) .each {|k,v| @@config[k.to_sym] = v if @valid_config_keys.include? k.to_sym} end |
.configure_with(path_to_yaml_file) ⇒ Object
Configure at global level through yaml file
30 31 32 33 |
# File 'lib/moodle.rb', line 30 def self.configure_with(path_to_yaml_file) config = YAML::load(IO.read(path_to_yaml_file)) configure(config) end |