Class: Pancake::Stacks::Short
- Inherits:
-
Pancake::Stack
- Object
- Pancake::Stack
- Pancake::Stacks::Short
- Defined in:
- lib/pancake/stacks/short/stack.rb,
lib/pancake/stacks/short/controller.rb
Defined Under Namespace
Classes: Controller
Instance Attribute Summary
Attributes inherited from Pancake::Stack
Class Method Summary collapse
- .as(*args) ⇒ Object
-
.delete(path, opts = {}, &block) ⇒ Object
Deletes the resource at a given path.
-
.get(path, opts = {}, &block) ⇒ Object
Gets a resource at a given path.
- .handle_exception(*args, &block) ⇒ Object
- .new_app_instance ⇒ Object
-
.post(path, opts = {}, &block) ⇒ Object
Posts a resource to a given path.
- .provides(*formats) ⇒ Object
-
.publish(*args) ⇒ Object
Marks a method as published.
-
.put(path, opts = {}, &block) ⇒ Object
Puts a resource to a given path.
Methods inherited from Pancake::Stack
_router, add_root, configuration, #configuration, create_bootloader_hook, #initialize, initialize_stack, initialized?, load_rake_tasks!, reset_router!, router, stackup, symlink_public_files!, with_router
Methods included from Hooks::OnInherit
extended, #inherited, #on_inherit
Methods included from Middleware
build, extended, #middlewares, #stack, #use
Methods included from Paths
#dirs_and_glob_for, #dirs_for, extended, #paths_for, #push_paths, #unique_paths_for
Constructor Details
This class inherits a constructor from Pancake::Stack
Class Method Details
.as(*args) ⇒ Object
22 23 24 |
# File 'lib/pancake/stacks/short/stack.rb', line 22 def self.as(*args) self::Controller.as(*args) end |
.delete(path, opts = {}, &block) ⇒ Object
Deletes the resource at a given path
The block should finish with the final result of the action
107 108 109 |
# File 'lib/pancake/stacks/short/stack.rb', line 107 def self.delete(path, opts = {}, &block) define_published_action(:delete, path, opts, block) end |
.get(path, opts = {}, &block) ⇒ Object
Gets a resource at a given path
The block should finish with the final result of the action
50 51 52 |
# File 'lib/pancake/stacks/short/stack.rb', line 50 def self.get(path, opts = {}, &block) define_published_action(:get, path, opts, block) end |
.handle_exception(*args, &block) ⇒ Object
31 32 33 |
# File 'lib/pancake/stacks/short/stack.rb', line 31 def self.handle_exception(*args, &block) self::Controller.handle_exception(*args, &block) end |
.new_app_instance ⇒ Object
6 7 8 |
# File 'lib/pancake/stacks/short/stack.rb', line 6 def self.new_app_instance self::Controller end |
.post(path, opts = {}, &block) ⇒ Object
Posts a resource to a given path
The block should finish with the final result of the action
69 70 71 |
# File 'lib/pancake/stacks/short/stack.rb', line 69 def self.post(path, opts = {}, &block) define_published_action(:post, path, opts, block) end |
.provides(*formats) ⇒ Object
27 28 29 |
# File 'lib/pancake/stacks/short/stack.rb', line 27 def self.provides(*formats) self::Controller.provides(*formats) end |
.publish(*args) ⇒ Object
Marks a method as published. This is done implicitly when using the get, post, put, delete methods on a Stacks::Short But can be done explicitly
16 17 18 19 |
# File 'lib/pancake/stacks/short/stack.rb', line 16 def self.publish(*args) @published = true self::Controller.publish(*args) end |
.put(path, opts = {}, &block) ⇒ Object
Puts a resource to a given path
The block should finish with the final result of the action
88 89 90 |
# File 'lib/pancake/stacks/short/stack.rb', line 88 def self.put(path, opts = {}, &block) define_published_action(:put, path, opts, block) end |