Class: Bixby::JsonRequest

Inherits:
Object
  • Object
show all
Includes:
HttpClient, Jsonify
Defined in:
lib/bixby_common/api/json_request.rb

Overview

Wraps a JSON Request

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HttpClient

#create_post_data, #http_get, #http_get_json, #http_post, #http_post_download, #http_post_json

Methods included from Jsonify

included, #to_json

Methods included from Hashify

#to_hash

Constructor Details

#initialize(operation, params) ⇒ JsonRequest

Create a new JsonRequest

Parameters:

  • operation (String)

    Name of operation

  • params (Array)

    Array of parameters; must ve valid JSON types



19
20
21
22
# File 'lib/bixby_common/api/json_request.rb', line 19

def initialize(operation, params)
  @operation = operation
  @params = params
end

Instance Attribute Details

#operationString

Name of operation

Returns:

  • (String)

    the current value of operation



8
9
10
# File 'lib/bixby_common/api/json_request.rb', line 8

def operation
  @operation
end

#paramsArray

Array of paramters; must be valid JSON types

Returns:

  • (Array)

    the current value of params



8
9
10
# File 'lib/bixby_common/api/json_request.rb', line 8

def params
  @params
end