class RBS::AST::Ruby::Members::AttributeMember
Attributes
type_annotation
[R]
Annotations::NodeTypeAssertion?
Public Class Methods
(Buffer, Prism::CallNode, Array[Prism::SymbolNode] name_nodes, RBS::AST::Ruby::CommentBlock? leading_comment, Annotations::NodeTypeAssertion? type_annotation) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/members.rb, line 645 def initialize(buffer, node, name_nodes, leading_comment, type_annotation) super(buffer) @node = node @name_nodes = name_nodes @leading_comment = leading_comment @type_annotation = type_annotation end
Calls superclass method
RBS::AST::Ruby::Members::Base::new
Public Instance Methods
() → Location
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/members.rb, line 659 def location rbs_location(node.location) end
() → Array[Location]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/members.rb, line 663 def name_locations name_nodes.map do |name_node| rbs_location(name_node.location) end end
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/members.rb, line 653 def names name_nodes.map do |node| node.unescaped.to_sym end end
() → Types::t?
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/members.rb, line 669 def type type_annotation&.type end
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/members.rb, line 673 def type_fingerprint [ "members/attribute", self.class.name, names.map(&:to_s), type_annotation&.type_fingerprint, leading_comment&.as_comment&.string ] end