Class: Steep::AST::Annotation::Dynamic::Name

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, kind:, location: nil) ⇒ Name

Returns a new instance of Name.



94
95
96
97
98
# File 'lib/steep/ast/annotation.rb', line 94

def initialize(name:, kind:, location: nil)
  @name = name
  @kind = kind
  @location = location
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



90
91
92
# File 'lib/steep/ast/annotation.rb', line 90

def kind
  @kind
end

#locationObject (readonly)

Returns the value of attribute location.



92
93
94
# File 'lib/steep/ast/annotation.rb', line 92

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



91
92
93
# File 'lib/steep/ast/annotation.rb', line 91

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



108
109
110
111
112
# File 'lib/steep/ast/annotation.rb', line 108

def ==(other)
  other.is_a?(Name) &&
    other.name == name &&
    other.kind == kind
end

#instance_method?Boolean

Returns:

  • (Boolean)


100
101
102
# File 'lib/steep/ast/annotation.rb', line 100

def instance_method?
  kind == :instance || kind == :module_instance
end

#module_method?Boolean

Returns:

  • (Boolean)


104
105
106
# File 'lib/steep/ast/annotation.rb', line 104

def module_method?
  kind == :module || kind == :module_instance
end