class LanguageServer::Project::Node

Public Class Methods

attribute_names() click to toggle source
# File lib/language_server/project/node.rb, line 17
def attribute_names
  @attribute_names ||= superclass.respond_to?(:attribute_names) ? superclass.attribute_names.dup : []
end
attributes(*attrs) click to toggle source
# File lib/language_server/project/node.rb, line 5
        def attributes(*attrs)
          attr_accessor(*attrs)
          attribute_names.concat(attrs)
          class_eval <<-RUBY, __FILE__, __LINE__ + 1
def initialize(#{attribute_names.map { |n| "#{n}:" }.join(",")})
  #{attribute_names.map { |n|
      "@#{n} = #{n}"
    }.join("\n")}
end
          RUBY
        end

Public Instance Methods

==(other) click to toggle source
# File lib/language_server/project/node.rb, line 36
def ==(other)
  eql?(other)
end
attributes() click to toggle source
# File lib/language_server/project/node.rb, line 44
def attributes
  self.class.attribute_names.map { |a|
    [a, public_send(a)]
  }.to_h
end
eql?(other) click to toggle source
# File lib/language_server/project/node.rb, line 32
def eql?(other)
  other.instance_of?(self.class) && attributes == other.attributes
end
hash() click to toggle source
# File lib/language_server/project/node.rb, line 40
def hash
  self.attributes.hash
end
local_path() click to toggle source
# File lib/language_server/project/node.rb, line 28
def local_path
  path.local_path
end
remote_path() click to toggle source
# File lib/language_server/project/node.rb, line 24
def remote_path
  path.remote_path
end