Class: TRuby::DocsExampleExtractor::CodeExample
- Inherits:
-
Struct
- Object
- Struct
- TRuby::DocsExampleExtractor::CodeExample
- Defined in:
- lib/t_ruby/docs_example_extractor.rb
Overview
Represents an extracted code example
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#language ⇒ Object
Returns the value of attribute language.
-
#line_number ⇒ Object
Returns the value of attribute line_number.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
Instance Method Summary collapse
- #rbs? ⇒ Boolean
- #ruby? ⇒ Boolean
- #should_compile? ⇒ Boolean
- #should_typecheck? ⇒ Boolean
- #should_verify? ⇒ Boolean
- #trb? ⇒ Boolean
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code
18 19 20 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 18 def code @code end |
#file_path ⇒ Object
Returns the value of attribute file_path
18 19 20 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 18 def file_path @file_path end |
#language ⇒ Object
Returns the value of attribute language
18 19 20 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 18 def language @language end |
#line_number ⇒ Object
Returns the value of attribute line_number
18 19 20 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 18 def line_number @line_number end |
#metadata ⇒ Object
Returns the value of attribute metadata
18 19 20 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 18 def end |
Instance Method Details
#rbs? ⇒ Boolean
34 35 36 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 34 def rbs? language == "rbs" end |
#ruby? ⇒ Boolean
30 31 32 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 30 def ruby? language == "ruby" end |
#should_compile? ⇒ Boolean
42 43 44 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 42 def should_compile? !&.include?("no-compile") end |
#should_typecheck? ⇒ Boolean
46 47 48 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 46 def should_typecheck? !&.include?("no-typecheck") end |
#should_verify? ⇒ Boolean
38 39 40 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 38 def should_verify? !&.include?("skip-verify") end |
#trb? ⇒ Boolean
26 27 28 |
# File 'lib/t_ruby/docs_example_extractor.rb', line 26 def trb? %w[trb t-ruby].include?(language) end |