Class: SystemNavigation::InstructionStream::Instruction::AttrReaderInstruction

Inherits:
AttrInstruction show all
Defined in:
lib/system_navigation/instruction_stream/instruction/attr_instruction.rb

Overview

Since:

  • 0.1.0

Instance Attribute Summary

Attributes inherited from AttrInstruction

#method, #visitor

Instance Method Summary collapse

Methods inherited from AttrInstruction

#accept, attrreaderinstr, attrwriterinstr, parse, #parse

Methods inherited from SystemNavigation::InstructionStream::Instruction

#accessing_cvar?, #accessing_gvar?, #accessing_ivar?, #duparrays?, #dynamically_reads_ivar?, #dynamically_writes_ivar?, #evaling_str, #evals?, #find_message, #parse, parse, #parse_cvar, #parse_gvar, #parse_ivar, #parse_lineno, #parse_op_id, #parse_opcode, #parse_operand, #parse_position, #parse_service_instruction, #parse_var, #putnils?, #putstrings?, #reads_cvar?, #reads_gvar?, #sends_msg?, #vm_operative?, #writes_cvar?, #writes_gvar?

Constructor Details

#initialize(sym) ⇒ AttrReaderInstruction

Returns a new instance of AttrReaderInstruction.

Since:

  • 0.1.0



41
42
43
# File 'lib/system_navigation/instruction_stream/instruction/attr_instruction.rb', line 41

def initialize(sym)
  @sym = sym
end

Instance Method Details

#putobjects?(sym) ⇒ Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



59
60
61
# File 'lib/system_navigation/instruction_stream/instruction/attr_instruction.rb', line 59

def putobjects?(sym)
  @sym == sym
end

#reads_ivar?(_sym) ⇒ Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



51
52
53
# File 'lib/system_navigation/instruction_stream/instruction/attr_instruction.rb', line 51

def reads_ivar?(_sym)
  true
end

#visit(obj) ⇒ Object

Since:

  • 0.1.0



45
46
47
48
49
# File 'lib/system_navigation/instruction_stream/instruction/attr_instruction.rb', line 45

def visit(obj)
  matched = obj.method.original_name.to_s == convert_accessor_to_name(@sym)
  obj.visitor = self if matched
  matched
end

#writes_ivar?(_sym) ⇒ Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0



55
56
57
# File 'lib/system_navigation/instruction_stream/instruction/attr_instruction.rb', line 55

def writes_ivar?(_sym)
  false
end