Class: Hologram::CodeExampleRenderer::Example

Inherits:
Struct
  • Object
show all
Defined in:
lib/hologram/code_example_renderer/example.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



3
4
5
# File 'lib/hologram/code_example_renderer/example.rb', line 3

def code
  @code
end

Instance Method Details

#code_exampleObject



8
9
10
# File 'lib/hologram/code_example_renderer/example.rb', line 8

def code_example
  formatter.format(lexer.lex(code)).strip
end

#get_bindingObject



12
13
14
# File 'lib/hologram/code_example_renderer/example.rb', line 12

def get_binding
  binding
end

#rendered_exampleObject



4
5
6
# File 'lib/hologram/code_example_renderer/example.rb', line 4

def rendered_example
  code
end