Class: DHC::Formats::Multipart

Inherits:
DHC::Format show all
Includes:
BasicMethodsConcern
Defined in:
lib/dhc/formats/multipart.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.request(options) ⇒ Object



7
8
9
10
# File 'lib/dhc/formats/multipart.rb', line 7

def self.request(options)
  options[:format] = new
  super(options)
end

Instance Method Details

#as_json(input) ⇒ Object



19
20
21
# File 'lib/dhc/formats/multipart.rb', line 19

def as_json(input)
  parse(input)
end

#as_open_struct(input) ⇒ Object



23
24
25
# File 'lib/dhc/formats/multipart.rb', line 23

def as_open_struct(input)
  parse(input)
end

#format_options(options) ⇒ Object



12
13
14
15
16
17
# File 'lib/dhc/formats/multipart.rb', line 12

def format_options(options)
  options[:headers] ||= {}
  no_content_type_header!(options)
  options[:headers]['Content-Type'] = 'multipart/form-data'
  options
end

#to_body(input) ⇒ Object



27
28
29
# File 'lib/dhc/formats/multipart.rb', line 27

def to_body(input)
  input
end

#to_sObject



31
32
33
# File 'lib/dhc/formats/multipart.rb', line 31

def to_s
  'multipart'
end

#to_symObject



35
36
37
# File 'lib/dhc/formats/multipart.rb', line 35

def to_sym
  to_s.to_sym
end