Class: RuboCop::Cop::HashShorthandSyntax::DefNode

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubocop/cop/mixin/hash_shorthand_syntax.rb

Instance Method Summary collapse

Instance Method Details

#first_argumentObject



225
226
227
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 225

def first_argument
  node.first_argument
end

#last_argumentObject



229
230
231
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 229

def last_argument
  node.last_argument
end

#selectorObject



217
218
219
220
221
222
223
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 217

def selector
  if node.loc.respond_to?(:selector)
    node.loc.selector
  else
    node.loc.keyword
  end
end