Class: Foodcritic::Gherkin::Tag
- Inherits:
-
Object
- Object
- Foodcritic::Gherkin::Tag
- Defined in:
- lib/foodcritic/gerkin/tag.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #attributes ⇒ Object
- #comments ⇒ Object
- #file ⇒ Object
- #file_colon_line ⇒ Object
-
#initialize(location, name) ⇒ Tag
constructor
A new instance of Tag.
- #inspect ⇒ Object
- #line ⇒ Object
- #location ⇒ Object
- #multiline_arg ⇒ Object
- #tags ⇒ Object
Constructor Details
#initialize(location, name) ⇒ Tag
Returns a new instance of Tag.
9 10 11 12 |
# File 'lib/foodcritic/gerkin/tag.rb', line 9 def initialize(location, name) @location = location @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/foodcritic/gerkin/tag.rb', line 7 def name @name end |
Instance Method Details
#attributes ⇒ Object
35 36 37 |
# File 'lib/foodcritic/gerkin/tag.rb', line 35 def attributes [, comments, multiline_arg].flatten end |
#comments ⇒ Object
44 45 46 47 |
# File 'lib/foodcritic/gerkin/tag.rb', line 44 def comments # will be overriden by nodes that actually have comments [] end |
#file ⇒ Object
22 23 24 |
# File 'lib/foodcritic/gerkin/tag.rb', line 22 def file location.file end |
#file_colon_line ⇒ Object
18 19 20 |
# File 'lib/foodcritic/gerkin/tag.rb', line 18 def file_colon_line location.to_s end |
#inspect ⇒ Object
14 15 16 |
# File 'lib/foodcritic/gerkin/tag.rb', line 14 def inspect %{#<#{self.class} "#{name}" (#{location})>} end |
#line ⇒ Object
26 27 28 |
# File 'lib/foodcritic/gerkin/tag.rb', line 26 def line location.line end |
#location ⇒ Object
30 31 32 33 |
# File 'lib/foodcritic/gerkin/tag.rb', line 30 def location raise('Please set @location in the constructor') unless defined?(@location) @location end |
#multiline_arg ⇒ Object
49 50 51 52 |
# File 'lib/foodcritic/gerkin/tag.rb', line 49 def multiline_arg # will be overriden by nodes that actually have a multiline_argument Test::EmptyMultilineArgument.new end |
#tags ⇒ Object
39 40 41 42 |
# File 'lib/foodcritic/gerkin/tag.rb', line 39 def # will be overriden by nodes that actually have tags [] end |