Skip to content

Commit

Permalink
Prepare Lisk 1.0.0 API, ref #1
Browse files Browse the repository at this point in the history
  • Loading branch information
4fryn committed Oct 27, 2017
1 parent 1303a3a commit 671e6df
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/lisk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

# The Lisk API Ruby wrapper gem.
module Lisk
require "lisk/api"
require "lisk/client"
require "lisk/legacy"

# Handles unimplemented methods
def self.method_missing
todo "#{self}::#{__method__} METHOD MISSING"
def method_missing(name, *args, &block)
todo "#{self}::#{name} METHOD MISSING"
end
end
190 changes: 190 additions & 0 deletions lib/lisk/api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# The Lisk API Ruby wrapper gem.
module Lisk

# Implements APIs of the Lisk Core node.
class API

# A "lisk/client" connecting to a Lisk Core API node.
attr_accessor :client

# Initializing the API with a Lisk Core API client.
def initialize client
if not client.nil?
@client = client
return self
else
return nil
end
end

#############################################
# https://github.com/4fryn/lisk.rb/issues/1 #
#############################################

# The "accounts" API
def accounts
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "blocks" API
def blocks
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "dapps" API
def dapps
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "delegates" API
def delegates
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "delegates/forgers" API
def delegates_forgers
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "delegates/forging" API
def delegates_forging
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "node/constants" API
def node_constants
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "node/status" API
def node_status
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "peers" API
def peers
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "signatures" API
def signatures
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "transactions" API
def transactions
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "transactions/unsigned" API
def transactions_unsigned
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "transactions/unconfirmed" API
def transactions_unconfirmed
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "transactions/unprocessed" API
def transactions_unprocessed
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "votes" API
def votes
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "voters" API
def voters
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "accounts" API
def accounts
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "blocks" API
def blocks
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "dapps" API
def dapps
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "delegates" API
def delegates
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "delegates/forgers" API
def delegates_forgers
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "delegates/forging" API
def delegates_forging
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "node/constants" API
def node_constants
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "node/status" API
def node_status
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "peers" API
def peers
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "signatures" API
def signatures
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "transactions" API
def transactions
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "transactions/unsigned" API
def transactions_unsigned
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "transactions/unconfirmed" API
def transactions_unconfirmed
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "transactions/unprocessed" API
def transactions_unprocessed
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "votes" API
def votes
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# The "voters" API
def voters
todo "#{self}::#{__method__} UNIMPLEMENTED"
end

# Handles unimplemented methods
def method_missing(name, *args, &block)
todo "#{self}::#{name} METHOD MISSING"
end

end
end
2 changes: 1 addition & 1 deletion lib/lisk/legacy.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The Lisk API Ruby wrapper gem.
module Lisk

# Implements legacy APIs of the Lisk Core pre-1.0.0 node
# Implements legacy APIs of the Lisk Core pre-1.0.0 node.
class Legacy

# A "lisk/client" connecting to a Lisk Core API node.
Expand Down

0 comments on commit 671e6df

Please sign in to comment.