Class: Shaf::Responder::AlpsJson

Inherits:
Base
  • Object
show all
Defined in:
lib/shaf/responder/alps_json.rb

Constant Summary

Constants inherited from Base

Base::PRELOAD_FAILED_MSG

Instance Attribute Summary

Attributes inherited from Base

#controller, #options, #resource

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#build_response, call, #initialize, #lookup_rel, mime_type, #preload_links, #serialized_hash, use_as_default!

Constructor Details

This class inherits a constructor from Shaf::Responder::Base

Class Method Details

.can_handle?(resource) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/shaf/responder/alps_json.rb', line 8

def self.can_handle?(resource)
  return false unless resource.is_a? Class
  resource <= Shaf::Profile
end

Instance Method Details

#bodyObject



13
14
15
# File 'lib/shaf/responder/alps_json.rb', line 13

def body
  JSON.generate hash
end