Class: AhoyCaptain::ApplicationQuery

Inherits:
Object
  • Object
show all
Defined in:
app/queries/ahoy_captain/application_query.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, query) ⇒ ApplicationQuery

Returns a new instance of ApplicationQuery.



20
21
22
23
# File 'app/queries/ahoy_captain/application_query.rb', line 20

def initialize(params, query)
  @params = params
  @query = query
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



19
20
21
# File 'app/queries/ahoy_captain/application_query.rb', line 19

def params
  @params
end

Class Method Details

.call(params, query = nil) ⇒ Object



15
16
17
# File 'app/queries/ahoy_captain/application_query.rb', line 15

def self.call(params, query = nil)
  new(params, query).send(:call)
end

.inherited(klass) ⇒ Object



10
11
12
13
# File 'app/queries/ahoy_captain/application_query.rb', line 10

def self.inherited(klass)
  klass.protected_methods :build
  klass.private_methods :call
end

Instance Method Details

#inspectObject



25
26
27
# File 'app/queries/ahoy_captain/application_query.rb', line 25

def inspect
  "<#{self.class.name}>"
end