Module: Xenon::Marshaller

Included in:
JsonMarshaller, XmlMarshaller
Defined in:
lib/xenon/marshallers.rb

Instance Method Summary collapse

Instance Method Details

#content_typeObject



5
6
7
# File 'lib/xenon/marshallers.rb', line 5

def content_type
  media_type.with_charset(Encoding::UTF_8)
end

#marshal?(media_range) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/xenon/marshallers.rb', line 13

def marshal?(media_range)
  media_range =~ media_type
end

#unmarshal?(media_type) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/xenon/marshallers.rb', line 9

def unmarshal?(media_type)
  media_type == self.media_type
end