Class: ZmeygoSync::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/zmeygo_sync/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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.expand_path(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_tokenObject

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_dirObject

Returns the value of attribute locale_dir.



8
9
10
# File 'lib/zmeygo_sync/configuration.rb', line 8

def locale_dir
  @locale_dir
end

#projectObject

Returns the value of attribute project.



8
9
10
# File 'lib/zmeygo_sync/configuration.rb', line 8

def project
  @project
end

#serverObject

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