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



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

def first_argument
  node.first_argument
end

#last_argumentObject



222
223
224
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 222

def last_argument
  node.last_argument
end

#selectorObject



210
211
212
213
214
215
216
# File 'lib/rubocop/cop/mixin/hash_shorthand_syntax.rb', line 210

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