Class: CryptoToolchain::DiffieHellman::ReceivedMessage
- Defined in:
- lib/crypto_toolchain/diffie_hellman/received_message.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(from:, contents:) ⇒ ReceivedMessage
constructor
A new instance of ReceivedMessage.
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
#contents ⇒ Object (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 |
#from ⇒ Object (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 |