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

DTK::DSL::FileType::SERVICE_INSTANCE_NESTED_MODULE_DIR, 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)


46
47
48
49
50
# File 'lib/dsl/file_type/subclasses.rb', line 46

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.



43
44
45
# File 'lib/dsl/file_type/subclasses.rb', line 43

def module_name
  @module_name
end

Instance Method Details

#base_dirObject



60
61
62
# File 'lib/dsl/file_type/subclasses.rb', line 60

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

#canonical_pathObject



56
57
58
# File 'lib/dsl/file_type/subclasses.rb', line 56

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

#indexObject



52
53
54
# File 'lib/dsl/file_type/subclasses.rb', line 52

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