Module: XRBP

Defined in:
lib/xrbp/dsl.rb,
lib/xrbp/common.rb,
lib/xrbp/crypto.rb,
lib/xrbp/version.rb,
lib/xrbp/crypto/key.rb,
lib/xrbp/model/base.rb,
lib/xrbp/model/node.rb,
lib/xrbp/crypto/node.rb,
lib/xrbp/crypto/seed.rb,
lib/xrbp/dsl/ledgers.rb,
lib/xrbp/dsl/accounts.rb,
lib/xrbp/model/ledger.rb,
lib/xrbp/model/market.rb,
lib/xrbp/nodestore/db.rb,
lib/xrbp/plugins/base.rb,
lib/xrbp/terminatable.rb,
lib/xrbp/dsl/webclient.rb,
lib/xrbp/dsl/websocket.rb,
lib/xrbp/model/account.rb,
lib/xrbp/model/gateway.rb,
lib/xrbp/overlay/frame.rb,
lib/xrbp/crypto/account.rb,
lib/xrbp/dsl/validators.rb,
lib/xrbp/nodestore/fees.rb,
lib/xrbp/nodestore/uint.rb,
lib/xrbp/model/validator.rb,
lib/xrbp/nodestore/sqldb.rb,
lib/xrbp/thread_registry.rb,
lib/xrbp/crypto/validator.rb,
lib/xrbp/nodestore/format.rb,
lib/xrbp/nodestore/ledger.rb,
lib/xrbp/nodestore/parser.rb,
lib/xrbp/nodestore/shamap.rb,
lib/xrbp/overlay/messages.rb,
lib/xrbp/websocket/client.rb,
lib/xrbp/websocket/socket.rb,
lib/xrbp/overlay/handshake.rb,
lib/xrbp/webclient/plugins.rb,
lib/xrbp/websocket/command.rb,
lib/xrbp/websocket/message.rb,
lib/xrbp/websocket/plugins.rb,
lib/xrbp/model/parsers/node.rb,
lib/xrbp/overlay/connection.rb,
lib/xrbp/plugins/has_plugin.rb,
lib/xrbp/model/parsers/quote.rb,
lib/xrbp/model/parsers/market.rb,
lib/xrbp/nodestore/amendments.rb,
lib/xrbp/webclient/connection.rb,
lib/xrbp/websocket/connection.rb,
lib/xrbp/model/parsers/account.rb,
lib/xrbp/model/parsers/gateway.rb,
lib/xrbp/nodestore/shamap/item.rb,
lib/xrbp/nodestore/shamap/node.rb,
lib/xrbp/plugins/result_parser.rb,
lib/xrbp/websocket/cmds/ledger.rb,
lib/xrbp/model/parsers/validator.rb,
lib/xrbp/nodestore/backends/nudb.rb,
lib/xrbp/nodestore/protocol/rate.rb,
lib/xrbp/nodestore/shamap/errors.rb,
lib/xrbp/nodestore/sle/st_amount.rb,
lib/xrbp/nodestore/sle/st_object.rb,
lib/xrbp/plugins/plugin_registry.rb,
lib/xrbp/nodestore/protocol/issue.rb,
lib/xrbp/nodestore/shamap/node_id.rb,
lib/xrbp/nodestore/sle/st_account.rb,
lib/xrbp/websocket/cmds/paginated.rb,
lib/xrbp/websocket/cmds/subscribe.rb,
lib/xrbp/websocket/multi/fallback.rb,
lib/xrbp/websocket/multi/parallel.rb,
lib/xrbp/websocket/cmds/account_tx.rb,
lib/xrbp/nodestore/backends/rocksdb.rb,
lib/xrbp/nodestore/protocol/indexes.rb,
lib/xrbp/nodestore/protocol/quality.rb,
lib/xrbp/nodestore/shamap/tree_node.rb,
lib/xrbp/plugins/has_result_parsers.rb,
lib/xrbp/websocket/cmds/book_offers.rb,
lib/xrbp/websocket/cmds/server_info.rb,
lib/xrbp/nodestore/protocol/currency.rb,
lib/xrbp/nodestore/shamap/inner_node.rb,
lib/xrbp/webclient/plugins/autoretry.rb,
lib/xrbp/websocket/cmds/account_info.rb,
lib/xrbp/websocket/cmds/ledger_entry.rb,
lib/xrbp/websocket/multi/prioritized.rb,
lib/xrbp/websocket/multi/round_robin.rb,
lib/xrbp/websocket/cmds/account_lines.rb,
lib/xrbp/nodestore/shamap/node_factory.rb,
lib/xrbp/nodestore/shamap/tagged_cache.rb,
lib/xrbp/nodestore/sle/st_ledger_entry.rb,
lib/xrbp/websocket/cmds/account_offers.rb,
lib/xrbp/websocket/plugins/autoconnect.rb,
lib/xrbp/websocket/cmds/account_objects.rb,
lib/xrbp/nodestore/backends/decompressor.rb,
lib/xrbp/webclient/plugins/result_parser.rb,
lib/xrbp/websocket/plugins/result_parser.rb,
lib/xrbp/websocket/multi/multi_connection.rb,
lib/xrbp/nodestore/sle/st_amount_arithmatic.rb,
lib/xrbp/nodestore/sle/st_amount_comparison.rb,
lib/xrbp/nodestore/sle/st_amount_conversion.rb,
lib/xrbp/websocket/plugins/command_paginator.rb,
lib/xrbp/websocket/plugins/command_dispatcher.rb,
lib/xrbp/websocket/plugins/connection_timeout.rb,
lib/xrbp/websocket/plugins/message_dispatcher.rb

Defined Under Namespace

Modules: Crypto, DSL, Model, NodeStore, Overlay, WebClient, WebSocket Classes: PluginBase, ResultParserBase, SHAMap

Constant Summary collapse

GENESIS_TIME =
DateTime.new(2013, 1, 1, 0, 0, 0)
VERSION =
'0.2.8'

Class Method Summary collapse

Class Method Details

.from_xrp_time(xrp_time) ⇒ Object

Convert XRP Ledger time to local time



12
13
14
15
# File 'lib/xrbp/common.rb', line 12

def self.from_xrp_time(xrp_time)
  return nil if xrp_time.nil?
  Time.at(xrp_time + 946684800)
end

.to_xrp_time(local_time) ⇒ Object

Convert local time to XRP Time



18
19
20
21
# File 'lib/xrbp/common.rb', line 18

def self.to_xrp_time(local_time)
  return nil if local_time.nil?
  local_time.to_i - 946684800
end