Class: PersistedQueries::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/persisted_queries/store.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.pathObject

Returns the value of attribute path.



7
8
9
# File 'lib/persisted_queries/store.rb', line 7

def path
  @path
end

.schemaObject

Returns the value of attribute schema.



6
7
8
# File 'lib/persisted_queries/store.rb', line 6

def schema
  @schema
end

Class Method Details

.add(client:, query:, hash:) ⇒ Object



21
22
23
24
# File 'lib/persisted_queries/store.rb', line 21

def add(client:, query:, hash:)
  path = client_path(client.underscore).mkpath
  AddOperation.new(client: client, query: query, hash: hash, store: self).perform
end

.client_path(client) ⇒ Object



26
27
28
# File 'lib/persisted_queries/store.rb', line 26

def client_path(client)
  path + client.to_s
end