Class: RBS::AST::Ruby::Members::InstanceVariableMember

Inherits:
Base
  • Object
show all
Defined in:
lib/rbs/ast/ruby/members.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#buffer

Instance Method Summary collapse

Methods included from Helpers::LocationHelper

#rbs_location

Constructor Details

#initialize(buffer, annotation) ⇒ InstanceVariableMember

Returns a new instance of InstanceVariableMember.



707
708
709
710
# File 'lib/rbs/ast/ruby/members.rb', line 707

def initialize(buffer, annotation)
  super(buffer)
  @annotation = annotation
end

Instance Attribute Details

#annotationObject (readonly)

Returns the value of attribute annotation.



705
706
707
# File 'lib/rbs/ast/ruby/members.rb', line 705

def annotation
  @annotation
end

Instance Method Details

#locationObject



720
721
722
# File 'lib/rbs/ast/ruby/members.rb', line 720

def location
  annotation.location
end

#nameObject



712
713
714
# File 'lib/rbs/ast/ruby/members.rb', line 712

def name
  annotation.ivar_name
end

#typeObject



716
717
718
# File 'lib/rbs/ast/ruby/members.rb', line 716

def type
  annotation.type
end

#type_fingerprintObject



724
725
726
727
728
729
# File 'lib/rbs/ast/ruby/members.rb', line 724

def type_fingerprint
  [
    "members/instance_variable",
    annotation.type_fingerprint
  ]
end