Module: Volt::Repos
- Included in:
- App
- Defined in:
- lib/volt/volt/repos.rb
Instance Method Summary collapse
- #check_for_client?(repo_name) ⇒ Boolean
- #cookies ⇒ Object
- #flash ⇒ Object
- #local_store ⇒ Object
- #page ⇒ Object
- #params ⇒ Object
- #store ⇒ Object
- #url ⇒ Object
Instance Method Details
#check_for_client?(repo_name) ⇒ Boolean
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 |
#cookies ⇒ Object
35 36 37 38 39 40 |
# File 'lib/volt/volt/repos.rb', line 35 def @cookies ||= begin check_for_client?('cookies') CookiesRoot.new({}, persistor: Persistors::Cookies) end end |
#flash ⇒ Object
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_store ⇒ Object
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 |
#page ⇒ Object
13 14 15 |
# File 'lib/volt/volt/repos.rb', line 13 def page @page ||= PageRoot.new end |
#params ⇒ Object
9 10 11 |
# File 'lib/volt/volt/repos.rb', line 9 def params @params ||= @url.params end |
#store ⇒ Object
17 18 19 |
# File 'lib/volt/volt/repos.rb', line 17 def store @store ||= StoreRoot.new({}, persistor: Persistors::StoreFactory.new(tasks)) end |