Class: Klenod::Build::LoadedModule

Inherits:
Object
  • Object
show all
Defined in:
lib/klenod/build/loaded_module.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, id) ⇒ LoadedModule

Returns a new instance of LoadedModule.



8
9
10
11
# File 'lib/klenod/build/loaded_module.rb', line 8

def initialize(context, id)
  @context = context
  @id = id
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



6
7
8
# File 'lib/klenod/build/loaded_module.rb', line 6

def context
  @context
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/klenod/build/loaded_module.rb', line 6

def id
  @id
end

Instance Method Details

#assets(type: nil, content_type: nil, recursive: true) ⇒ Object



29
30
31
# File 'lib/klenod/build/loaded_module.rb', line 29

def assets(type: nil, content_type: nil, recursive: true)
  context.assets_for_module(id, type: type, content_type: content_type, recursive: recursive)
end

#callObject



25
26
27
# File 'lib/klenod/build/loaded_module.rb', line 25

def call(...)
  exports.call(...)
end

#evaluated?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/klenod/build/loaded_module.rb', line 21

def evaluated?
  context.evaluated?(id)
end

#exportsObject



17
18
19
# File 'lib/klenod/build/loaded_module.rb', line 17

def exports
  context.exports(id)
end

#recordObject



13
14
15
# File 'lib/klenod/build/loaded_module.rb', line 13

def record
  context.graph.records.fetch(id)
end

#to_sObject



33
34
35
# File 'lib/klenod/build/loaded_module.rb', line 33

def to_s
  id.to_s
end