Class: WsdlMapper::Generation::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl_mapper/generation/context.rb

Instance Method Summary (collapse)

Constructor Details

- (Context) initialize(target_path)

Returns a new instance of Context

Parameters:

  • target_path (String)

    Absolute root path



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.

Parameters:

  • type_name (TypeName)

Returns:

  • (String)

    The full absolute file path for the specified type_name



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.

Parameters:

  • paths (Array<String>)

    An array of paths

Returns:

  • (String)

    An absolute path as string



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