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



215
216
217
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 215

def first_argument
  node.first_argument
end

#last_argumentObject



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

def last_argument
  node.last_argument
end

#selectorObject



207
208
209
210
211
212
213
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 207

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