class Infurarb::Connection

Attributes

api_key[R]
network[R]

Public Class Methods

new(api_key:, network:) click to toggle source
# File lib/infurarb/connection.rb, line 6
def initialize(api_key:, network:)
  @api_key = api_key
  @network = network
end

Public Instance Methods

method_missing(method_name, *params) click to toggle source
Calls superclass method
# File lib/infurarb/connection.rb, line 15
def method_missing(method_name, *params)
  return super unless Request::RPC_METHODS.include?(method_name)

  Request.new(endpoint: endpoint, method_name: method_name, params: params).call
end
respond_to_missing?() click to toggle source
# File lib/infurarb/connection.rb, line 11
def respond_to_missing?
  true
end

Private Instance Methods

endpoint() click to toggle source
# File lib/infurarb/connection.rb, line 23
def endpoint
  @endpoint ||= "https://#{network}.infura.io/v3/#{api_key}"
end