Restfulie::Common and Restfulie::Client dependencies are mixed
up. Currently, Representation is in the Common package but if your
client code, therefore if your Representation requires accessing
Client, it is too early to do that, obliying you to replicate code
among Common and Client. i.e.:
module Restfulie::Common::Representation
class Link
def initialize(options = {})
@options = options
end
def href
@options["href"]
end
def rel
@options["rel"]
end
end
::Hash.instance_eval {
include Restfulie::Client::HTTP::LinkShortcut
}
# Implements the interface for marshal Xml media type requests
(application/xml) class XmlD
cattr_reader :media_type_name
@@media_type_name = 'application/xml'
cattr_reader :headers
@@headers = {
:post => { 'Content-Type' => media_type_name }
}
def unmarshal(string)
Hash.from_xml(string)
end
def marshal(string, rel)
string
end
end
end