Class: RuboCounsel::Example
- Inherits:
-
Object
- Object
- RuboCounsel::Example
- Defined in:
- lib/rubocounsel/example.rb
Overview
Represents a parsed @example tag from RuboCop cop documentation.
Example names in RuboCop follow patterns like:
"EnforcedStyle: single_quotes (default)"
"EnforcedStyle: double_quotes"
"EnforcedStyleForLeadingUnderscores :optional" (inconsistent spacing)
"Using splat expansion" (no attribute/value)
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #default? ⇒ Boolean
-
#initialize(yard_example) ⇒ Example
constructor
A new instance of Example.
Constructor Details
#initialize(yard_example) ⇒ Example
Returns a new instance of Example.
14 15 16 17 18 19 |
# File 'lib/rubocounsel/example.rb', line 14 def initialize(yard_example) @name = yard_example.name @text = yard_example.text parse_name end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
12 13 14 |
# File 'lib/rubocounsel/example.rb', line 12 def attribute @attribute end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/rubocounsel/example.rb', line 12 def name @name end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
12 13 14 |
# File 'lib/rubocounsel/example.rb', line 12 def text @text end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
12 13 14 |
# File 'lib/rubocounsel/example.rb', line 12 def value @value end |
Instance Method Details
#default? ⇒ Boolean
21 22 23 |
# File 'lib/rubocounsel/example.rb', line 21 def default? @default end |