Class: Mila::Benchmark::Mixin::JS::Body::Inline

Inherits:
Object
  • Object
show all
Defined in:
lib/mila/benchmark/mixin.rb

Instance Method Summary collapse

Constructor Details

#initialize(body = '') ⇒ Inline

Returns a new instance of Inline.



8
9
10
# File 'lib/mila/benchmark/mixin.rb', line 8

def initialize(body = '')
  @body = body
end

Instance Method Details

#entrypoint_nameObject



16
17
18
# File 'lib/mila/benchmark/mixin.rb', line 16

def entrypoint_name
  raise 'Cannot call entrypoint_name on inline code'
end

#loadObject



20
21
22
# File 'lib/mila/benchmark/mixin.rb', line 20

def load
  @body
end

#open(&block) ⇒ Object



12
13
14
# File 'lib/mila/benchmark/mixin.rb', line 12

def open(&block)
  @body = block.call
end