Class: LazopApiClient::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/lazop_api_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_name = nil, http_method = 'POST') ⇒ Request

Returns a new instance of Request.



213
214
215
216
217
218
# File 'lib/lazop_api_client.rb', line 213

def initialize(api_name = nil,http_method = 'POST')
    @api_name , @http_method = api_name,http_method
    @api_params = Hash.new
    @header_params = Hash.new
    @file_params = Hash.new
end

Instance Method Details

#add_api_parameter(key, value) ⇒ Object



220
221
222
223
224
225
226
# File 'lib/lazop_api_client.rb', line 220

def add_api_parameter(key,value)
    if key.kind_of? String
        @api_params[key] = value
    else
        raise 'api param key is not String'  
    end
end

#add_file_parameter(key, file_path) ⇒ Object

file_path must be String



237
238
239
240
241
242
243
# File 'lib/lazop_api_client.rb', line 237

def add_file_parameter(key,file_path)
    if (key.kind_of? String) && (file_path.kind_of? String)
        @file_params[key] = file_path
    else
        raise 'http param key is not String'  
    end
end

#add_http_parameter(key, value) ⇒ Object



228
229
230
231
232
233
234
# File 'lib/lazop_api_client.rb', line 228

def add_http_parameter(key,value)
    if key.kind_of? String
        @header_params[key] = value
    else
        raise 'http param key is not String'  
    end
end

#api_nameObject



257
258
259
# File 'lib/lazop_api_client.rb', line 257

def api_name
    @api_name
end

#api_paramsObject



253
254
255
# File 'lib/lazop_api_client.rb', line 253

def api_params
    @api_params
end

#file_paramsObject



265
266
267
# File 'lib/lazop_api_client.rb', line 265

def file_params
    @file_params
end

#header_paramsObject



269
270
271
# File 'lib/lazop_api_client.rb', line 269

def header_params
    @header_params
end

#http_methodObject



261
262
263
# File 'lib/lazop_api_client.rb', line 261

def http_method
    @http_method
end

#set_timestamp=(value) ⇒ Object



249
250
251
# File 'lib/lazop_api_client.rb', line 249

def set_timestamp=(value)
    @timestamp = value
end

#timestampObject



245
246
247
# File 'lib/lazop_api_client.rb', line 245

def timestamp
    @timestamp
end