Class: Restfully::MediaType::Wildcard::IdentityParser

Inherits:
Object
  • Object
show all
Defined in:
lib/restfully/media_type/wildcard.rb

Class Method Summary collapse

Class Method Details

.dump(object, *args) ⇒ Object



16
17
18
# File 'lib/restfully/media_type/wildcard.rb', line 16

def self.dump(object, *args)
  object
end

.load(object, *args) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/restfully/media_type/wildcard.rb', line 6

def self.load(object, *args)
  if object.respond_to? :to_str
    object = object.to_str
  elsif object.respond_to? :to_io
    object = object.to_io.read
  else
    object = object.read
  end
end