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
14 15 16 |
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 14 def node @node end |
Instance Method Details
#first_argument ⇒ Object
23 24 25 |
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 23 def first_argument node.first_argument end |
#last_argument ⇒ Object
27 28 29 |
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 27 def last_argument node.last_argument end |
#selector ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 15 def selector if node.loc.respond_to?(:selector) node.loc.selector else node.loc.keyword end end |