Class: Ciri::DevP2P::RLPX::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/ciri/devp2p/rlpx/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node_id:, ip:, udp_port:, tcp_port:, added_at: nil) ⇒ Node


62
63
64
65
66
67
68
# File 'lib/ciri/devp2p/rlpx/node.rb', line 62

def initialize(node_id:, ip:, udp_port:, tcp_port:, added_at: nil)
  @node_id = node_id
  @ip = ip
  @udp_port = udp_port
  @tcp_port = tcp_port
  @added_at = added_at
end

Instance Attribute Details

#added_atObject (readonly)

Returns the value of attribute added_at


60
61
62
# File 'lib/ciri/devp2p/rlpx/node.rb', line 60

def added_at
  @added_at
end

#ipObject (readonly)

Returns the value of attribute ip


60
61
62
# File 'lib/ciri/devp2p/rlpx/node.rb', line 60

def ip
  @ip
end

#node_idObject (readonly)

Returns the value of attribute node_id


60
61
62
# File 'lib/ciri/devp2p/rlpx/node.rb', line 60

def node_id
  @node_id
end

#tcp_portObject (readonly)

Returns the value of attribute tcp_port


60
61
62
# File 'lib/ciri/devp2p/rlpx/node.rb', line 60

def tcp_port
  @tcp_port
end

#udp_portObject (readonly)

Returns the value of attribute udp_port


60
61
62
# File 'lib/ciri/devp2p/rlpx/node.rb', line 60

def udp_port
  @udp_port
end

Instance Method Details

#==(other) ⇒ Object


70
71
72
# File 'lib/ciri/devp2p/rlpx/node.rb', line 70

def == (other)
  self.class == other.class && node_id == other.node_id
end