Method: Lnrpc::Client#initialize
- Defined in:
- lib/lnrpc/client.rb
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/lnrpc/client.rb', line 32 def initialize(={}) self.address = [:address] || DEFAULT_ADDRESS if .has_key?(:credentials) self.credentials = [:credentials] elsif File.exists?(::File.([:credentials_path] || DEFAULT_CREDENTIALS_PATH)) self.credentials = ::File.read(::File.([:credentials_path] || DEFAULT_CREDENTIALS_PATH)) else self.credentials = nil end if !.has_key?(:macaroon) && File.exists?(::File.([:macaroon_path] || DEFAULT_MACAROON_PATH)) [:macaroon] = ::File.read(::File.([:macaroon_path] || DEFAULT_MACAROON_PATH)).unpack("H*") end self.macaroon = [:macaroon] end |