Class: RestPack::Service::Commands::Get
- Inherits:
-
RestPack::Service::Command
- Object
- Mutations::Command
- RestPack::Service::Command
- RestPack::Service::Commands::Get
- Defined in:
- lib/restpack_service/commands/get.rb
Instance Attribute Summary
Attributes inherited from RestPack::Service::Command
Instance Method Summary collapse
Methods inherited from RestPack::Service::Command
#Model, #Serializer, #field_error, inherited, #init, #run, #service_error, #status, #valid?
Instance Method Details
#execute ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/restpack_service/commands/get.rb', line 4 def execute result = self.class.serializer_class.resource(inputs) if result[self.class.serializer_class.key].empty? status :not_found else result end end |