Class: Sequence::Account::ClientModule
- Inherits:
-
ClientModule
- Object
- ClientModule
- Sequence::Account::ClientModule
- Defined in:
- lib/sequence/account.rb
Instance Attribute Summary
Attributes inherited from ClientModule
Instance Method Summary collapse
-
#create(opts = {}) ⇒ Account
Creates a new account in the ledger.
-
#list(opts = {}) ⇒ Query
Filters accounts.
-
#query(opts = {}) ⇒ Query
deprecated
Deprecated.
Use list instead.
-
#update_tags(opts = {}) ⇒ void
Updates an account’s tags.
Methods inherited from ClientModule
Constructor Details
This class inherits a constructor from Sequence::ClientModule
Instance Method Details
#create(opts = {}) ⇒ Account
Creates a new account in the ledger.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/sequence/account.rb', line 74 def create(opts = {}) validate_inclusion_of!( opts, :alias, :id, :key_ids, :keys, :quorum, :tags, ) if (opts[:key_ids].nil? || opts[:key_ids].empty?) && (opts[:keys].nil? || opts[:keys].empty?) raise( ArgumentError, ':key_ids or :keys (but not both) must be provided', ) end Account.new(client.session.request('create-account', opts)) end |
#list(opts = {}) ⇒ Query
Filters accounts.
148 149 150 151 152 153 154 155 |
# File 'lib/sequence/account.rb', line 148 def list(opts = {}) validate_inclusion_of!( opts, :filter, :filter_params, ) Query.new(client, opts) end |
#query(opts = {}) ⇒ Query
Deprecated.
Use list instead.
Executes a query, returning an enumerable over individual accounts.
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/sequence/account.rb', line 128 def query(opts = {}) validate_inclusion_of!( opts, :filter, :filter_params, :page_size, :after, ) Query.new(client, opts) end |
#update_tags(opts = {}) ⇒ void
This method returns an undefined value.
Updates an account’s tags.
107 108 109 110 111 112 113 114 |
# File 'lib/sequence/account.rb', line 107 def (opts = {}) validate_inclusion_of!(opts, :id, :alias, :tags) if (opts[:id].nil? || opts[:id].empty?) && (opts[:alias].nil? || opts[:alias].empty?) raise ArgumentError, ':id or :alias (but not both) must be provided' end client.session.request('update-account-tags', opts) end |