class ParamsReady::QueryContext

Attributes

data[R]

Public Class Methods

new(restriction, data = {}) click to toggle source
# File lib/params_ready/query_context.rb, line 11
def initialize(restriction, data = {})
  @data = data.freeze
  raise ParamsReadyError, "Restriction expected, got: #{restriction.inspect}" unless restriction.is_a? Restriction
  @restriction = restriction.freeze
end

Public Instance Methods

clone(restriction:) click to toggle source
# File lib/params_ready/query_context.rb, line 17
def clone(restriction:)
  QueryContext.new restriction, data
end