Class: Twostroke::AST::MemberAccess

Inherits:
Base
  • Object
show all
Defined in:
lib/twostroke/ast/member_access.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#line

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Twostroke::AST::Base

Instance Attribute Details

#memberObject

Returns the value of attribute member.



3
4
5
# File 'lib/twostroke/ast/member_access.rb', line 3

def member
  @member
end

#objectObject

Returns the value of attribute object.



3
4
5
# File 'lib/twostroke/ast/member_access.rb', line 3

def object
  @object
end

Instance Method Details

#collapseObject



5
6
7
# File 'lib/twostroke/ast/member_access.rb', line 5

def collapse
  self.class.new object: object.collapse, member: member
end

#walk(&bk) ⇒ Object



9
10
11
12
13
# File 'lib/twostroke/ast/member_access.rb', line 9

def walk(&bk)
  if yield self
    object.walk &bk
  end
end