Class: Rubinius::AST::SendPrivately

Inherits:
Send
  • Object
show all
Defined in:
lib/compiler/ast/transforms.rb

Overview

Handles Rubinius.privately

Instance Attribute Summary

Attributes inherited from Send

#block, #check_for_local, #name, #privately, #receiver, #variable

Attributes inherited from Node

#line

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Send

#arguments_sexp, #check_local_reference, #initialize, #receiver_sexp, #sexp_name, #to_sexp

Methods inherited from Node

#ascii_graph, #attributes, #children, #initialize, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, #to_sexp, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk

Constructor Details

This class inherits a constructor from Rubinius::AST::Send

Class Method Details

.match?(line, receiver, name, arguments, privately) ⇒ Boolean

Returns:

  • (Boolean)


147
148
149
150
151
# File 'lib/compiler/ast/transforms.rb', line 147

def self.match?(line, receiver, name, arguments, privately)
  if match_send? receiver, :Rubinius, name, :privately
    new line, receiver, name, privately
  end
end

Instance Method Details

#block=(iter) ⇒ Object



153
154
155
# File 'lib/compiler/ast/transforms.rb', line 153

def block=(iter)
  @block = iter.body
end

#map_sendsObject



157
158
159
160
161
162
163
164
165
166
# File 'lib/compiler/ast/transforms.rb', line 157

def map_sends
  walk do |result, node|
    case node
    when Send, SendWithArguments
      node.privately = true
    end

    result
  end
end