Class: PluginFile

Inherits:
Object
  • Object
show all
Defined in:
lib/core/plugin_file.rb

Overview

Represents the

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(absolute_path, plugin_type) ⇒ PluginFile

Returns a new instance of PluginFile.



8
9
10
11
# File 'lib/core/plugin_file.rb', line 8

def initialize(absolute_path, plugin_type)
  @absolute_path = absolute_path
  @plugin_type = plugin_type
end

Instance Attribute Details

#absolute_pathObject (readonly)

Returns the value of attribute absolute_path.



6
7
8
# File 'lib/core/plugin_file.rb', line 6

def absolute_path
  @absolute_path
end

#plugin_typeObject (readonly)

Returns the value of attribute plugin_type.



6
7
8
# File 'lib/core/plugin_file.rb', line 6

def plugin_type
  @plugin_type
end

Instance Method Details

#instance_nameObject



13
14
15
# File 'lib/core/plugin_file.rb', line 13

def instance_name
  plugin_name.gsub(StringHelper.camelize(@plugin_type), "")
end

#module_class_nameObject



21
22
23
# File 'lib/core/plugin_file.rb', line 21

def module_class_name
  "#{plugin_name}::#{instance_name}"
end

#plugin_nameObject



17
18
19
# File 'lib/core/plugin_file.rb', line 17

def plugin_name
  StringHelper.camelize(File.basename(@absolute_path, ".rb"))
end