Class: Swift::Playground::Section::TemplateContext

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/swift/playground/section.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, number, playground) ⇒ TemplateContext

Returns a new instance of TemplateContext.



26
27
28
29
30
# File 'lib/swift/playground/section.rb', line 26

def initialize(content, number, playground)
  @content = content
  @number = number
  @playground = playground
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



13
14
15
# File 'lib/swift/playground/section.rb', line 13

def content
  @content
end

#numberObject

Returns the value of attribute number.



13
14
15
# File 'lib/swift/playground/section.rb', line 13

def number
  @number
end

Class Method Details

.context(*args) ⇒ Object



18
19
20
# File 'lib/swift/playground/section.rb', line 18

def self.context(*args)
  new(*args).instance_eval { binding }
end

Instance Method Details

#contextObject



22
23
24
# File 'lib/swift/playground/section.rb', line 22

def context
  binding
end