Class: Sequence::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/sequence/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(ledger_name:, credential:) ⇒ Query

Set up a Sequence client. This is the entry point for all other Sequence interaction.

Parameters:

  • ledger_name (String)

    Ledger name.

  • credential (String)

    API credential secret.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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

  @opts = {
    credential: credential,
    ledger_name: ledger_name,
  }
  @session = Session.new(@opts)
end

Instance Method Details

#accountsAccount::ClientModule



48
49
50
# File 'lib/sequence/client.rb', line 48

def accounts
  @accounts ||= Account::ClientModule.new(self)
end

#actionsAction::ClientModule



53
54
55
# File 'lib/sequence/client.rb', line 53

def actions
  @actions ||= Action::ClientModule.new(self)
end

#dev_utilsDevUtils::ClientModule



89
90
91
# File 'lib/sequence/client.rb', line 89

def dev_utils
  @dev_utils ||= DevUtils::ClientModule.new(self)
end

#feedsFeed::ClientModule

Returns:



58
59
60
# File 'lib/sequence/client.rb', line 58

def feeds
  @feeds ||= Feed::ClientModule.new(self)
end

#flavorsFlavor::ClientModule



63
64
65
# File 'lib/sequence/client.rb', line 63

def flavors
  @flavors ||= Flavor::ClientModule.new(self)
end

#keysKey::ClientModule

Returns:



68
69
70
# File 'lib/sequence/client.rb', line 68

def keys
  @keys ||= Key::ClientModule.new(self)
end

#tokensToken::ClientModule

Returns:



79
80
81
# File 'lib/sequence/client.rb', line 79

def tokens
  @tokens ||= Token::ClientModule.new(self)
end

#transactionsTransaction::ClientModule



84
85
86
# File 'lib/sequence/client.rb', line 84

def transactions
  @transactions ||= Transaction::ClientModule.new(self)
end