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



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

def first_argument
  node.first_argument
end

#last_argumentObject



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

def last_argument
  node.last_argument
end

#selectorObject



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

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