I am unable to use the Proc returned by valid_transaction as argument in the select filter. This is the code I am using.
require 'json'
module Electrum
class History
def self.valid_transaction
lambda { |tx| tx["date"] == "----" }
end
def self.list
JSON::parse `electrum history`
end
def self.confirmed
list.reject { |tx| tx["date"] == "----" }
end
def self.unconfirmed
list.select(&:valid_transaction)
end
end
end