class WsdlMapper::Generation::Context
Public Class Methods
new(target_path)
click to toggle source
@param [String] target_path Absolute root path
# File lib/wsdl_mapper/generation/context.rb, line 5 def initialize(target_path) @target_path = target_path end
Public Instance Methods
path_for(type_name)
click to toggle source
Returns the absolute path for a specified `type_name`. If the directories do not exist, it will create them before returning. @param [TypeName] type_name @return [String] The full absolute file path for the specified `type_name`
# 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
path_join(*paths)
click to toggle source
Returns an absolute path for the specified `paths`. @param [Array<String>] paths An array of paths @return [String] An absolute path as string
# File lib/wsdl_mapper/generation/context.rb, line 23 def path_join(*paths) path = File.join @target_path, *paths path end
Private Instance Methods
ensure_path_exists(path)
click to toggle source
# File lib/wsdl_mapper/generation/context.rb, line 30 def ensure_path_exists(path) FileUtils.mkpath path end