Class: Docs::ERBEnvironment
- Inherits:
-
Object
- Object
- Docs::ERBEnvironment
- Includes:
- ExampleHelper
- Defined in:
- lib/docs/erb_environment.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
<%= config.api_endpoint %>.
-
#content ⇒ Object
Returns the value of attribute content.
-
#examples ⇒ Object
writeonly
Sets the attribute examples.
Instance Method Summary collapse
Methods included from ExampleHelper
Instance Attribute Details
#config ⇒ Object
<%= config.api_endpoint %>
10 11 12 |
# File 'lib/docs/erb_environment.rb', line 10 def config @config end |
#content ⇒ Object
Returns the value of attribute content.
9 10 11 |
# File 'lib/docs/erb_environment.rb', line 9 def content @content end |
#examples=(value) ⇒ Object (writeonly)
Sets the attribute examples
8 9 10 |
# File 'lib/docs/erb_environment.rb', line 8 def examples=(value) @examples = value end |
Instance Method Details
#get_binding ⇒ Object
26 27 28 |
# File 'lib/docs/erb_environment.rb', line 26 def get_binding binding end |
#pretty_print_json(json) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/docs/erb_environment.rb', line 14 def pretty_print_json(json) begin JSON.pretty_generate(JSON.parse(json)) rescue JSON::ParserError => e e.inspect end end |
#syntax_highlight(str, language) ⇒ Object
22 23 24 |
# File 'lib/docs/erb_environment.rb', line 22 def syntax_highlight(str, language) CodeRay.scan(str, language).div end |