Class: Rubycop::Analyzer::Ruby::Call

Inherits:
Node
  • Object
show all
Defined in:
lib/rubycop/analyzer/ruby/call.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#accept

Constructor Details

#initialize(target, identifier, arguments = nil, block = nil) ⇒ Call

Returns a new instance of Call.



5
6
7
8
9
10
# File 'lib/rubycop/analyzer/ruby/call.rb', line 5

def initialize(target, identifier, arguments=nil, block=nil)
  @target     = target
  @identifier = identifier
  @arguments  = arguments
  @block      = block
end

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



14
15
16
# File 'lib/rubycop/analyzer/ruby/call.rb', line 14

def arguments
  @arguments
end

#blockObject

Returns the value of attribute block.



15
16
17
# File 'lib/rubycop/analyzer/ruby/call.rb', line 15

def block
  @block
end

#identifierObject (readonly)

Returns the value of attribute identifier.



13
14
15
# File 'lib/rubycop/analyzer/ruby/call.rb', line 13

def identifier
  @identifier
end

#targetObject (readonly)

Returns the value of attribute target.



12
13
14
# File 'lib/rubycop/analyzer/ruby/call.rb', line 12

def target
  @target
end

Instance Method Details

#assignment(rvalue, operator) ⇒ Object



17
18
19
# File 'lib/rubycop/analyzer/ruby/call.rb', line 17

def assignment(rvalue, operator)
  self.class.new(@target, Identifier.new("#{@identifier.token}=", @identifier.position), @arguments, @block)
end