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.



57
58
59
60
# File 'lib/steep/ast/annotation.rb', line 57

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



55
56
57
# File 'lib/steep/ast/annotation.rb', line 55

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



54
55
56
# File 'lib/steep/ast/annotation.rb', line 54

def name
  @name
end

Instance Method Details

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



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

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

#hashObject



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

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