Class: Mud::InstalledModule

Inherits:
Module
  • Object
show all
Defined in:
lib/mud/installed_module.rb

Instance Attribute Summary collapse

Attributes inherited from Module

#context, #dependencies, #name

Instance Method Summary collapse

Methods inherited from Module

#==, #depends_on?, parse_name, #resolvable?, #to_s, #unresolvable_dependencies

Constructor Details

#initialize(path, context) ⇒ InstalledModule

Returns a new instance of InstalledModule.



6
7
8
9
10
11
12
# File 'lib/mud/installed_module.rb', line 6

def initialize(path, context)
  super(path, File.open(path) { |f| f.read }, context)
  @content = nil

  @path = path
  @modified = File.mtime(path)
end

Instance Attribute Details

#modifiedObject (readonly)

Returns the value of attribute modified.



4
5
6
# File 'lib/mud/installed_module.rb', line 4

def modified
  @modified
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/mud/installed_module.rb', line 4

def path
  @path
end

Instance Method Details

#contentObject



14
15
16
# File 'lib/mud/installed_module.rb', line 14

def content
  File.open(@path) { |f| f.read }
end