Class: Disloku::Config::Target
- Inherits:
-
Object
- Object
- Disloku::Config::Target
- Defined in:
- lib/disloku/config/Target.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, targetConfig, mappingStore, connectionStore) ⇒ Target
constructor
A new instance of Target.
- #mapPath(pathSegments) ⇒ Object
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(name, targetConfig, mappingStore, connectionStore) ⇒ Target
Returns a new instance of Target.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/disloku/config/Target.rb', line 10 def initialize(name, targetConfig, mappingStore, connectionStore) @name = name @config = targetConfig if (@config["connection"].value().kind_of?(String)) @connection = connectionStore.get(@config["connection"].value()) else @connection = Connection.new(@config["connection"]) end @mapping = Mapping.new(@config, mappingStore) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/disloku/config/Target.rb', line 27 def method_missing(name, *args, &block) if (!@config.has?(name.to_s())) return nil end return @config[name.to_s()].value() end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
8 9 10 |
# File 'lib/disloku/config/Target.rb', line 8 def connection @connection end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/disloku/config/Target.rb', line 8 def name @name end |
Instance Method Details
#mapPath(pathSegments) ⇒ Object
23 24 25 |
# File 'lib/disloku/config/Target.rb', line 23 def mapPath(pathSegments) return @mapping.mapPath(pathSegments) end |