class Optidash::Request::Fetch

Responsible for handling Fetch requests

Public Class Methods

new(key) click to toggle source
Calls superclass method Optidash::Request::Base::new
# File lib/optidash/request.rb, line 83
def initialize(key)
    @type = :fetch
    super(key)
end

Public Instance Methods

request_data() click to toggle source

Returns fetch request data, which is a simple JSON

# File lib/optidash/request.rb, line 91
def request_data
    @data.to_json
end

Private Instance Methods

headers(binary: false) click to toggle source
Calls superclass method Optidash::Request::Base#headers
# File lib/optidash/request.rb, line 97
def headers(binary: false)
    @headers ||= { content_type: :json }
    super
end