Class: Multibases::Registration

Inherits:
Struct
  • Object
show all
Defined in:
lib/multibases/registry.rb

Overview

rubocop:enable Style/MutableConstant

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



8
9
10
# File 'lib/multibases/registry.rb', line 8

def code
  @code
end

#encodingObject

Returns the value of attribute encoding

Returns:

  • (Object)

    the current value of encoding



8
9
10
# File 'lib/multibases/registry.rb', line 8

def encoding
  @encoding
end

#engineObject

Returns the value of attribute engine

Returns:

  • (Object)

    the current value of engine



8
9
10
# File 'lib/multibases/registry.rb', line 8

def engine
  @engine
end

Instance Method Details

#==(other) ⇒ Object



13
14
15
16
17
# File 'lib/multibases/registry.rb', line 13

def ==(other)
  return [encoding, code].include?(other) if other.is_a?(String)

  eql?(other)
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/multibases/registry.rb', line 19

def eql?(other)
  other.is_a?(Registration) && other.encoding == encoding
end

#hashObject



9
10
11
# File 'lib/multibases/registry.rb', line 9

def hash
  encoding.hash
end