Module: Gizmo
- Defined in:
- lib/gizmo.rb,
lib/gizmo/aop.rb,
lib/gizmo/find.rb,
lib/gizmo/make.rb,
lib/gizmo/delete.rb,
lib/gizmo/models.rb,
lib/gizmo/modify.rb,
lib/gizmo/search.rb,
lib/gizmo/version.rb,
lib/gizmo/find_all.rb,
lib/gizmo/models/error.rb,
lib/gizmo/base_operation.rb,
lib/gizmo/models/context.rb,
lib/gizmo/models/response.rb,
lib/gizmo/aop/exception_handling.rb,
lib/gizmo/models/validation_error.rb
Defined Under Namespace
Classes: BaseOperation, Context, Delete, Error, ExceptionHandling, Find, FindAll, Make, Modify, Response, Search, ValidationError
Constant Summary collapse
- VERSION =
"0.0.2"
Class Attribute Summary collapse
-
.logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#delete(*args) ⇒ Gizmo::Response
Delete an item.
-
#find(*args) ⇒ Gizmo::Response
Find an item.
-
#find_all(*args) ⇒ Gizmo::Response
Find all items.
-
#make(*args) ⇒ Gizmo::Response
Make a new instance of an item.
-
#modify(*args) ⇒ Gizmo::Response
Modify an item.
- #search(*args) ⇒ Object
Class Attribute Details
.logger ⇒ Object
Returns the value of attribute logger.
19 20 21 |
# File 'lib/gizmo.rb', line 19 def logger @logger end |
Instance Method Details
#delete(*args) ⇒ Gizmo::Response
Delete an item
83 84 85 86 |
# File 'lib/gizmo.rb', line 83 def delete(*args) context = create_context Delete.new(context).call(*args) end |
#find(*args) ⇒ Gizmo::Response
Find an item
41 42 43 44 |
# File 'lib/gizmo.rb', line 41 def find(*args) context = create_context Find.new(context).call(*args) end |
#find_all(*args) ⇒ Gizmo::Response
Find all items
27 28 29 30 31 32 33 |
# File 'lib/gizmo.rb', line 27 def find_all(*args) context = create_context operation = FindAll.new(context) response = operation.call(*args) operation.set_response_headers response response end |
#make(*args) ⇒ Gizmo::Response
Make a new instance of an item
57 58 59 60 61 62 63 |
# File 'lib/gizmo.rb', line 57 def make(*args) context = create_context operation = Make.new(context) response = operation.call(*args) operation.set_response_headers response response end |
#modify(*args) ⇒ Gizmo::Response
Modify an item
72 73 74 75 |
# File 'lib/gizmo.rb', line 72 def modify(*args) context = create_context Modify.new(context).call(*args) end |