lib/restfulie/common/representation/json.rb in restfulie-0.8.0 vs lib/restfulie/common/representation/json.rb in restfulie-0.8.1

- old
+ new

@@ -1,25 +1,13 @@ -module Restfulie::Common::Representation - - # Implements the interface for marshal Xml media type requests (application/xml) - class Json - - cattr_reader :media_type_name - @@media_type_name = 'application/json' - - cattr_reader :headers - @@headers = { - :post => { 'Content-Type' => media_type_name } - } - - def unmarshal(string) - JSON.parse(string) +module Restfulie + module Common + module Representation + class Json + autoload :Base, 'restfulie/common/representation/json/base' + autoload :KeysAsMethods, 'restfulie/common/representation/json/keys_as_methods' + autoload :Link, 'restfulie/common/representation/json/link' + autoload :LinkCollection, 'restfulie/common/representation/json/link_collection' + extend Base::ClassMethods + end end - - def marshal(entity, rel) - return entity if entity.kind_of? String - entity.to_json - end - end - end