Module: Volt::Repos

Included in:
App
Defined in:
lib/volt/volt/repos.rb

Instance Method Summary collapse

Instance Method Details

#check_for_client?(repo_name) ⇒ Boolean

Returns:



42
43
44
45
46
# File 'lib/volt/volt/repos.rb', line 42

def check_for_client?(repo_name)
  unless Volt.client?
    fail "The #{repo_name} collection can only be accessed from the client side currently"
  end
end

#cookiesObject



35
36
37
38
39
40
# File 'lib/volt/volt/repos.rb', line 35

def cookies
  @cookies ||= begin
    check_for_client?('cookies')
    CookiesRoot.new({}, persistor: Persistors::Cookies)
  end
end

#flashObject



21
22
23
24
25
26
# File 'lib/volt/volt/repos.rb', line 21

def flash
  @flash ||= begin
    check_for_client?('flash')
    FlashRoot.new({}, persistor: Persistors::Flash)
  end
end

#local_storeObject



28
29
30
31
32
33
# File 'lib/volt/volt/repos.rb', line 28

def local_store
  @local_store ||= begin
    check_for_client?('local_store')
    LocalStoreRoot.new({}, persistor: Persistors::LocalStore)
  end
end

#pageObject



13
14
15
# File 'lib/volt/volt/repos.rb', line 13

def page
  @page ||= PageRoot.new
end

#paramsObject



9
10
11
# File 'lib/volt/volt/repos.rb', line 9

def params
  @params ||= @url.params
end

#storeObject



17
18
19
# File 'lib/volt/volt/repos.rb', line 17

def store
  @store ||= StoreRoot.new({}, persistor: Persistors::StoreFactory.new(tasks))
end

#urlObject



5
6
7
# File 'lib/volt/volt/repos.rb', line 5

def url
  @url ||= URL.new
end