Class: Ooor::Connection
- Inherits:
-
Object
- Object
- Ooor::Connection
- Defined in:
- lib/ooor/connection.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#connection_session ⇒ Object
Returns the value of attribute connection_session.
Instance Method Summary collapse
- #class_name_from_model_key(model_key) ⇒ Object
- #helper_paths ⇒ Object
-
#initialize(config, env = false) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(config, env = false) ⇒ Connection
Returns a new instance of Connection.
12 13 14 15 |
# File 'lib/ooor/connection.rb', line 12 def initialize(config, env=false) @config = _config(config) Object.const_set(@config[:scope_prefix], Module.new) if @config[:scope_prefix] end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/ooor/connection.rb', line 10 def config @config end |
#connection_session ⇒ Object
Returns the value of attribute connection_session.
10 11 12 |
# File 'lib/ooor/connection.rb', line 10 def connection_session @connection_session end |
Instance Method Details
#class_name_from_model_key(model_key) ⇒ Object
25 26 27 |
# File 'lib/ooor/connection.rb', line 25 def class_name_from_model_key(model_key) model_key.split('.').collect {|name_part| name_part.capitalize}.join end |
#helper_paths ⇒ Object
21 22 23 |
# File 'lib/ooor/connection.rb', line 21 def helper_paths [File.dirname(__FILE__) + '/helpers/*', *@config[:helper_paths]] end |