Class: Steep::AST::Annotation::Implements::Module

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/ast/annotation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, args:) ⇒ Module

Returns a new instance of Module.



64
65
66
67
# File 'lib/steep/ast/annotation.rb', line 64

def initialize(name:, args:)
  @name = name
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



62
63
64
# File 'lib/steep/ast/annotation.rb', line 62

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



61
62
63
# File 'lib/steep/ast/annotation.rb', line 61

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



69
70
71
# File 'lib/steep/ast/annotation.rb', line 69

def ==(other)
  other.is_a?(Module) && other.name == name && other.args == args
end

#hashObject



75
76
77
# File 'lib/steep/ast/annotation.rb', line 75

def hash
  self.class.hash ^ name.hash ^ args.hash
end