123456789_123456789_123456789_123456789_123456789_

Class: RBS::Annotate::Annotations::Source

Relationships & Source Files
Inherits: Object
Defined in: lib/rbs/annotate/annotations.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(annotation:, include: nil, skip: nil) ⇒ Source

[ GitHub ]

  
# File 'lib/rbs/annotate/annotations.rb', line 31

def initialize(annotation:, include: nil, skip: nil)
  @annotation = annotation
  @include_source = include
  @skip_source = skip
end

Instance Attribute Details

#annotation (readonly)

[ GitHub ]

  
# File 'lib/rbs/annotate/annotations.rb', line 28

attr_reader :annotation

#include_source (readonly)

[ GitHub ]

  
# File 'lib/rbs/annotate/annotations.rb', line 29

attr_reader :include_source, :skip_source

#skip_source (readonly)

[ GitHub ]

  
# File 'lib/rbs/annotate/annotations.rb', line 29

attr_reader :include_source, :skip_source

Instance Method Details

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

[ GitHub ]

  
# File 'lib/rbs/annotate/annotations.rb', line 41

def ==(other)
  other.is_a?(Source) &&
    other.annotation == annotation &&
    other.include_source == include_source &&
    other.skip_source == skip_source
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'lib/rbs/annotate/annotations.rb', line 48

alias eql? ==

#hash

[ GitHub ]

  
# File 'lib/rbs/annotate/annotations.rb', line 37

def hash
  self.class.hash ^ annotation.hash ^ include_source.hash ^ skip_source.hash
end