Class: DTK::DSL::FileType::ServiceInstance::NestedModule

Inherits:
DTK::DSL::FileType::ServiceInstance show all
Defined in:
lib/dsl/file_type/subclasses.rb

Direct Known Subclasses

DSLFile

Defined Under Namespace

Classes: DSLFile

Constant Summary

Constants inherited from DTK::DSL::FileType

TYPES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DTK::DSL::FileType::ServiceInstance

top_level_type

Methods inherited from DTK::DSL::FileType

#backup_path, backup_path, base_dir, canonical_path, file_type_instance_if_match?, #matches?, matches?, matching_files_array?, print_name, regexp, type_level_type

Constructor Details

#initialize(params = {}) ⇒ NestedModule

params can have keys:

:module_name (required)


57
58
59
60
61
# File 'lib/dsl/file_type/subclasses.rb', line 57

def initialize(params = {})
  unless @module_name = params[:module_name]
    raise Error, "Unexpected that opts[:module_name] is nil"
  end
end

Instance Attribute Details

#module_nameObject (readonly)

Returns the value of attribute module_name.



54
55
56
# File 'lib/dsl/file_type/subclasses.rb', line 54

def module_name
  @module_name
end

Instance Method Details

#base_dirObject



71
72
73
# File 'lib/dsl/file_type/subclasses.rb', line 71

def base_dir
  matching_type_def(:base_dir_lambda).call(:module_name => @module_name)
end

#canonical_pathObject



67
68
69
# File 'lib/dsl/file_type/subclasses.rb', line 67

def canonical_path
  self.class.canonical_path_lambda.call(:module_name => @module_name)
end

#indexObject



63
64
65
# File 'lib/dsl/file_type/subclasses.rb', line 63

def index
  "#{super}--#{@module_name}"
end