Class: Sequence::Client
- Inherits:
-
Object
- Object
- Sequence::Client
- Defined in:
- lib/sequence/client.rb
Instance Method Summary collapse
- #accounts ⇒ Account::ClientModule
- #actions ⇒ Action::ClientModule
- #dev_utils ⇒ DevUtils::ClientModule
- #feeds ⇒ Feed::ClientModule
- #flavors ⇒ Flavor::ClientModule
-
#initialize(ledger_name:, credential:) ⇒ Query
constructor
Set up a Sequence client.
- #keys ⇒ Key::ClientModule
- #opts ⇒ Object
- #session ⇒ Session
- #stats ⇒ Stats::ClientModule
- #tokens ⇒ Token::ClientModule
- #transactions ⇒ Transaction::ClientModule
Constructor Details
#initialize(ledger_name:, credential:) ⇒ Query
Set up a Sequence client. This is the entry point for all other Sequence interaction.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/sequence/client.rb', line 23 def initialize(ledger_name:, credential:) if ledger_name.nil? || ledger_name == '' raise ArgumentError, ':ledger_name cannot be blank' end if credential.nil? || credential == '' raise ArgumentError, ':credential cannot be blank' end addr = ENV['SEQADDR'] || 'api.seq.com' api = HttpWrapper.new('https://' + addr, credential) @opts = { addr: addr, credential: credential, ledger_name: ledger_name, team_name: team_name(api), } end |
Instance Method Details
#accounts ⇒ Account::ClientModule
53 54 55 |
# File 'lib/sequence/client.rb', line 53 def accounts @accounts ||= Account::ClientModule.new(self) end |
#actions ⇒ Action::ClientModule
63 64 65 |
# File 'lib/sequence/client.rb', line 63 def actions @actions ||= Action::ClientModule.new(self) end |
#dev_utils ⇒ DevUtils::ClientModule
94 95 96 |
# File 'lib/sequence/client.rb', line 94 def dev_utils @dev_utils ||= DevUtils::ClientModule.new(self) end |
#feeds ⇒ Feed::ClientModule
83 84 85 |
# File 'lib/sequence/client.rb', line 83 def feeds @feeds ||= Feed::ClientModule.new(self) end |
#flavors ⇒ Flavor::ClientModule
58 59 60 |
# File 'lib/sequence/client.rb', line 58 def flavors @flavors ||= Flavor::ClientModule.new(self) end |
#keys ⇒ Key::ClientModule
68 69 70 |
# File 'lib/sequence/client.rb', line 68 def keys @keys ||= Key::ClientModule.new(self) end |
#opts ⇒ Object
42 43 44 |
# File 'lib/sequence/client.rb', line 42 def opts @opts.dup end |
#session ⇒ Session
48 49 50 |
# File 'lib/sequence/client.rb', line 48 def session @session ||= Session.new(@opts) end |
#stats ⇒ Stats::ClientModule
89 90 91 |
# File 'lib/sequence/client.rb', line 89 def stats @stats ||= Stats::ClientModule.new(self) end |
#tokens ⇒ Token::ClientModule
73 74 75 |
# File 'lib/sequence/client.rb', line 73 def tokens @tokens ||= Token::ClientModule.new(self) end |
#transactions ⇒ Transaction::ClientModule
78 79 80 |
# File 'lib/sequence/client.rb', line 78 def transactions @transactions ||= Transaction::ClientModule.new(self) end |