Class: RuboCop::Cop::HashShorthandSyntax::DefNode
- Inherits:
-
Struct
- Object
- Struct
- RuboCop::Cop::HashShorthandSyntax::DefNode
- Defined in:
- lib/rubocop/cop/mixin/hash_shorthand_syntax.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
Returns the value of attribute node.
Instance Method Summary collapse
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node
23 24 25 |
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 23 def node @node end |
Instance Method Details
#first_argument ⇒ Object
32 33 34 |
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 32 def first_argument node.first_argument end |
#last_argument ⇒ Object
36 37 38 |
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 36 def last_argument node.last_argument end |
#selector ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 24 def selector if node.loc?(:selector) node.loc.selector else node.loc.keyword end end |