Class: Nem::Node

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/nem/node.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Node

Returns a new instance of Node.

Parameters:

  • options (hash) (defaults to: {})

    HTTP Client connection information

Options Hash (options):

  • :url (String)

    URL

  • :scheme (String)

    default http

  • :host (Symbol)

    default 127.0.0.1

  • :port (Integer)

    default 7890

  • :timeout (Integer)

    default 5



13
14
15
# File 'lib/nem/node.rb', line 13

def initialize(options = {})
  @client = Nem::Client.new(options)
end

Instance Method Details

#heartbeatObject



17
18
19
# File 'lib/nem/node.rb', line 17

def heartbeat
  Nem::Model::Heartbeat.new request!(:get, '/heartbeat')
end

#shutdownObject



25
26
27
# File 'lib/nem/node.rb', line 25

def shutdown
  request!(:get, '/shutdown')
end

#statusObject



21
22
23
# File 'lib/nem/node.rb', line 21

def status
  Nem::Model::Status.new request!(:get, '/status')
end