Class: CryptoToolchain::DiffieHellman::ReceivedMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/crypto_toolchain/diffie_hellman/received_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from:, contents:) ⇒ ReceivedMessage

Returns a new instance of ReceivedMessage.



4
5
6
7
# File 'lib/crypto_toolchain/diffie_hellman/received_message.rb', line 4

def initialize(from: , contents: )
  @from = from
  @contents = contents
end

Instance Attribute Details

#contentsObject (readonly)

Returns the value of attribute contents.



14
15
16
# File 'lib/crypto_toolchain/diffie_hellman/received_message.rb', line 14

def contents
  @contents
end

#fromObject (readonly)

Returns the value of attribute from.



14
15
16
# File 'lib/crypto_toolchain/diffie_hellman/received_message.rb', line 14

def from
  @from
end

Instance Method Details

#==(other) ⇒ Object



9
10
11
12
13
# File 'lib/crypto_toolchain/diffie_hellman/received_message.rb', line 9

def ==(other)
  unless other.is_a?(CryptoToolchain::DiffieHellman::ReceivedMessage)
    raise ArgumentError.new("Cannot coerce #{other.clas} to ReceivedMessage")
  end
end