Class: WsdlMapper::Generation::Context
- Inherits:
-
Object
- Object
- WsdlMapper::Generation::Context
- Defined in:
- lib/wsdl_mapper/generation/context.rb
Instance Method Summary (collapse)
-
- (Context) initialize(target_path)
constructor
A new instance of Context.
-
- (String) path_for(type_name)
Returns the absolute path for a specified
type_name
. -
- (String) path_join(*paths)
Returns an absolute path for the specified
paths
.
Constructor Details
- (Context) initialize(target_path)
Returns a new instance of Context
5 6 7 |
# File 'lib/wsdl_mapper/generation/context.rb', line 5 def initialize(target_path) @target_path = target_path end |
Instance Method Details
- (String) path_for(type_name)
Returns the absolute path for a specified type_name
. If the directories do not exist,
it will create them before returning.
13 14 15 16 17 18 |
# File 'lib/wsdl_mapper/generation/context.rb', line 13 def path_for(type_name) path = path_join type_name.file_path ensure_path_exists path File.join path, type_name.file_name end |
- (String) path_join(*paths)
Returns an absolute path for the specified paths
.
23 24 25 26 27 |
# File 'lib/wsdl_mapper/generation/context.rb', line 23 def path_join(*paths) path = File.join @target_path, *paths path end |