class Bcoin::Client::Collection

Attributes

client[R]
collection[R]
error[R]

Public Class Methods

new(client, collection = []) click to toggle source
# File lib/bcoin/client/collection.rb, line 12
def initialize client, collection = []
  @client = client
  @collection = collection
end

Public Instance Methods

base_path() click to toggle source

Redefine in sub class

# File lib/bcoin/client/collection.rb, line 22
def base_path
  '/collection'
end
each(&block) click to toggle source
# File lib/bcoin/client/collection.rb, line 26
def each &block
  @collection.each {|w| block.call(w) }
end
error=(_error) click to toggle source
# File lib/bcoin/client/collection.rb, line 41
def error=(_error)
  @error = _error
end
error?() click to toggle source
# File lib/bcoin/client/collection.rb, line 37
def error?
  @error ? true : false
end
inspect() click to toggle source
# File lib/bcoin/client/collection.rb, line 17
def inspect
  printf "#<%s @collection=%p>", self.class.name, @collection
end
refresh!(path = '') click to toggle source

Allow for overriding of the path for situations like the wallet list retrieval. See the comment for Wallets#base_path for details.

# File lib/bcoin/client/collection.rb, line 33
def refresh! path = ''
  get path + '/'
end