Sha256: ff5d35c62be0947e81ea8e9c955b76163e2d004f4e8e1850ef2713aacb95677e

Contents?: true

Size: 702 Bytes

Versions: 29

Compression:

Stored size: 702 Bytes

Contents

# frozen_string_literal: true

module LHC::Formats
  class Form < LHC::Format
    include LHC::BasicMethodsConcern

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

    def format_options(options)
      options[:headers] ||= {}
      no_content_type_header!(options)
      options[:headers]['Content-Type'] = 'application/x-www-form-urlencoded'
      options
    end

    def as_json(input)
      parse(input)
    end

    def as_open_struct(input)
      parse(input)
    end

    def to_body(input)
      input
    end

    def to_s
      'form'
    end

    def to_sym
      to_s.to_sym
    end

    private

    def parse(input)
      input
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
lhc-15.2.1 lib/lhc/formats/form.rb
lhc-15.2.0 lib/lhc/formats/form.rb
lhc-15.1.3 lib/lhc/formats/form.rb
lhc-15.1.2 lib/lhc/formats/form.rb
lhc-15.1.1 lib/lhc/formats/form.rb
lhc-15.1.0 lib/lhc/formats/form.rb
lhc-16.0.0.pre.pro2162.2 lib/lhc/formats/form.rb
lhc-16.0.0.pre.pro2162 lib/lhc/formats/form.rb
lhc-15.0.1 lib/lhc/formats/form.rb
lhc-15.0.0 lib/lhc/formats/form.rb
lhc-14.0.0 lib/lhc/formats/form.rb
lhc-13.4.0.pre.pro1766.1 lib/lhc/formats/form.rb
lhc-13.2.0 lib/lhc/formats/form.rb
lhc-13.1.0 lib/lhc/formats/form.rb
lhc-13.0.0 lib/lhc/formats/form.rb
lhc-12.3.0 lib/lhc/formats/form.rb
lhc-12.2.1 lib/lhc/formats/form.rb
lhc-12.2.0 lib/lhc/formats/form.rb
lhc-12.1.3 lib/lhc/formats/form.rb
lhc-12.1.2 lib/lhc/formats/form.rb