Class: ZmeygoSync::Configuration
- Inherits:
-
Object
- Object
- ZmeygoSync::Configuration
- Defined in:
- lib/zmeygo_sync/configuration.rb
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#locale_dir ⇒ Object
Returns the value of attribute locale_dir.
-
#project ⇒ Object
Returns the value of attribute project.
-
#server ⇒ Object
Returns the value of attribute server.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 |
# File 'lib/zmeygo_sync/configuration.rb', line 10 def initialize conf_file = File.join(Rails.root,'config','zmeygo_sync.yml') conf_all = YAML.load_file(File.(conf_file)) conf = conf_all[Rails.env] # conf['server'] = 'http://zmeygo.com' self.api_token = conf['api_token'] self.project = conf['project'] end |
Instance Attribute Details
#api_token ⇒ Object
Returns the value of attribute api_token.
8 9 10 |
# File 'lib/zmeygo_sync/configuration.rb', line 8 def api_token @api_token end |
#locale_dir ⇒ Object
Returns the value of attribute locale_dir.
8 9 10 |
# File 'lib/zmeygo_sync/configuration.rb', line 8 def locale_dir @locale_dir end |
#project ⇒ Object
Returns the value of attribute project.
8 9 10 |
# File 'lib/zmeygo_sync/configuration.rb', line 8 def project @project end |
#server ⇒ Object
Returns the value of attribute server.
8 9 10 |
# File 'lib/zmeygo_sync/configuration.rb', line 8 def server @server end |
Instance Method Details
#[](key) ⇒ Object
19 20 21 22 23 |
# File 'lib/zmeygo_sync/configuration.rb', line 19 def [](key) if self.respond_to?(key) send(key) end end |