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.



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

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



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

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



52
53
54
# File 'lib/steep/ast/annotation.rb', line 52

def name
  @name
end

Instance Method Details

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



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

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

#hashObject



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

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