Class: Sequence::Flavor::ClientModule
- Inherits:
-
ClientModule
- Object
- ClientModule
- Sequence::Flavor::ClientModule
- Defined in:
- lib/sequence/flavor.rb
Instance Attribute Summary
Attributes inherited from ClientModule
Instance Method Summary collapse
-
#create(opts = {}) ⇒ Flavor
Creates a new flavor in the ledger.
-
#list(opts = {}) ⇒ Query
Executes a query, returning an enumerable over individual flavors.
-
#update_tags(opts = {}) ⇒ void
Updates a flavor’s tags.
Methods inherited from ClientModule
Constructor Details
This class inherits a constructor from Sequence::ClientModule
Instance Method Details
#create(opts = {}) ⇒ Flavor
Creates a new flavor in the ledger.
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/sequence/flavor.rb', line 67 def create(opts = {}) validate_inclusion_of!(opts, :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 Flavor.new(client.session.request('create-flavor', opts)) end |
#list(opts = {}) ⇒ Query
Executes a query, returning an enumerable over individual flavors.
103 104 105 106 107 108 109 110 |
# File 'lib/sequence/flavor.rb', line 103 def list(opts = {}) validate_inclusion_of!( opts, :filter, :filter_params, ) Query.new(client, opts) end |
#update_tags(opts = {}) ⇒ void
This method returns an undefined value.
Updates a flavor’s tags.
87 88 89 90 91 92 93 |
# File 'lib/sequence/flavor.rb', line 87 def (opts = {}) validate_inclusion_of!(opts, :id, :tags) if opts[:id].nil? || opts[:id].empty? raise ArgumentError, ':id must be provided' end client.session.request('update-flavor-tags', opts) end |