lib/peatio/ndc/hooks.rb in peatio-ndc-0.2.1 vs lib/peatio/ndc/hooks.rb in peatio-ndc-0.2.2

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Peatio module Ndc module Hooks BLOCKCHAIN_VERSION_REQUIREMENT = "~> 1.0.0" WALLET_VERSION_REQUIREMENT = "~> 1.0.0" @@ -10,26 +12,26 @@ .satisfied_by?(Gem::Version.new(Peatio::Blockchain::VERSION)) [ "Ndc blockchain version requiremnt was not suttisfied by Peatio::Blockchain.", "Ndc blockchain requires #{BLOCKCHAIN_VERSION_REQUIREMENT}.", "Peatio::Blockchain version is #{Peatio::Blockchain::VERSION}" - ].join('\n').tap { |s| Kernel.abort s } + ].join('\n').tap {|s| Kernel.abort s } end unless Gem::Requirement.new(WALLET_VERSION_REQUIREMENT) .satisfied_by?(Gem::Version.new(Peatio::Wallet::VERSION)) [ "Ndc wallet version requiremnt was not suttisfied by Peatio::Wallet.", "Ndc wallet requires #{WALLET_VERSION_REQUIREMENT}.", "Peatio::Wallet version is #{Peatio::Wallet::VERSION}" - ].join('\n').tap { |s| Kernel.abort s } + ].join('\n').tap {|s| Kernel.abort s } end end def register - Peatio::Blockchain.registry[:ndc] = Ndc::Blockchain.new - Peatio::Wallet.registry[:ndcd] = Ndc::Wallet.new + Peatio::Blockchain.registry[:ndc] = Ndc::Blockchain + Peatio::Wallet.registry[:ndcd] = Ndc::Wallet end end if defined?(Rails::Railtie) require "peatio/ndc/railtie" @@ -38,5 +40,6 @@ register end end end end +