class HornOfPlenty::Queries::Fetch

Attributes

query[RW]

Public Class Methods

new(attrs) click to toggle source
# File lib/horn_of_plenty/queries/fetch.rb, line 7
def initialize(attrs)
  self.query = attrs.dup
end

Public Instance Methods

to_h() click to toggle source
# File lib/horn_of_plenty/queries/fetch.rb, line 11
def to_h
  @to_h ||= translate(query)
end
Also aliased as: to_params
to_params()
Alias for: to_h

Private Instance Methods

change_value(key:, from:, to:) click to toggle source
# File lib/horn_of_plenty/queries/fetch.rb, line 29
def change_value(key:, from:, to:)
  return unless query.has_key?(key)

  query[key] = to if query[key] == from
end
rename_key(from:, to:) click to toggle source
# File lib/horn_of_plenty/queries/fetch.rb, line 22
def rename_key(from:, to:)
  return unless query.has_key?(from)

  query[to] = query[from]
  query.delete(from)
end
translate(query) click to toggle source
# File lib/horn_of_plenty/queries/fetch.rb, line 18
def translate(query)
  query
end