Class: Sequence::Transaction::ClientModule

Inherits:
ClientModule show all
Defined in:
lib/sequence/transaction.rb

Instance Attribute Summary

Attributes inherited from ClientModule

#client

Instance Method Summary collapse

Methods inherited from ClientModule

#initialize

Constructor Details

This class inherits a constructor from Sequence::ClientModule

Instance Method Details

#list(opts = {}) ⇒ Query

Executes a query, returning an enumerable over individual transactions.

Parameters:

  • opts (Hash) (defaults to: {})

    Options hash

Options Hash (opts):

  • filter (String)

    A filter expression.

  • filter_params (Array<String|Integer>)

    A list of values that will be interpolated into the filter expression.

Returns:



93
94
95
96
97
98
99
100
# File 'lib/sequence/transaction.rb', line 93

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 transactions.

Parameters:

  • opts (Hash) (defaults to: {})

    Options hash

Options Hash (opts):

  • filter (String)

    A filter expression.

  • filter_params (Array<String|Integer>)

    A list of values that will be interpolated into the filter expression.

  • start_time (Integer)

    A Unix timestamp in milliseconds of the earliest transaction timestamp to include in the query results.

  • end_time (Integer)

    A Unix timestamp in milliseconds of the most recent transaction timestamp to include in the query results.

  • ] (Integer)

    page_size Deprecated. Use list.page(size: size) instead. The number of items to return in the result set.

Returns:



82
83
84
# File 'lib/sequence/transaction.rb', line 82

def query(opts = {})
  Query.new(client, opts)
end

#transact(builder = nil) { ... } ⇒ Object

Builds, signs, and submits a transaction.

Parameters:

  • builder (Builder) (defaults to: nil)

    Builder object with actions defined. If provided, overrides block parameter.

Yields:

  • Block defining transaction actions. A Builder object is passed as the only parameter.

Returns:

  • Transaction



55
56
57
58
59
60
61
62
63
# File 'lib/sequence/transaction.rb', line 55

def transact(builder = nil, &block)
  if builder.nil?
    builder = Builder.new(&block)
  end

  Transaction.new(
    client.session.request('transact', builder),
  )
end