Class: RubyCop::Ruby::Call

Inherits:
Node
  • Object
show all
Defined in:
lib/ruby_cop/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.



4
5
6
7
8
9
# File 'lib/ruby_cop/ruby/call.rb', line 4

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.



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

def arguments
  @arguments
end

#blockObject

Returns the value of attribute block.



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

def block
  @block
end

#identifierObject (readonly)

Returns the value of attribute identifier.



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

def identifier
  @identifier
end

#targetObject (readonly)

Returns the value of attribute target.



11
12
13
# File 'lib/ruby_cop/ruby/call.rb', line 11

def target
  @target
end

Instance Method Details

#assignment(rvalue, operator) ⇒ Object



16
17
18
# File 'lib/ruby_cop/ruby/call.rb', line 16

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