Class: LazopApiClient::Request
- Inherits:
-
Object
- Object
- LazopApiClient::Request
- Defined in:
- lib/lazop_api_client.rb
Instance Method Summary collapse
- #add_api_parameter(key, value) ⇒ Object
-
#add_file_parameter(key, file_path) ⇒ Object
file_path must be String.
- #add_http_parameter(key, value) ⇒ Object
- #api_name ⇒ Object
- #api_params ⇒ Object
- #file_params ⇒ Object
- #header_params ⇒ Object
- #http_method ⇒ Object
-
#initialize(api_name = nil, http_method = 'POST') ⇒ Request
constructor
A new instance of Request.
- #set_timestamp=(value) ⇒ Object
- #timestamp ⇒ Object
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_name ⇒ Object
257 258 259 |
# File 'lib/lazop_api_client.rb', line 257 def api_name @api_name end |
#api_params ⇒ Object
253 254 255 |
# File 'lib/lazop_api_client.rb', line 253 def api_params @api_params end |
#file_params ⇒ Object
265 266 267 |
# File 'lib/lazop_api_client.rb', line 265 def file_params @file_params end |
#header_params ⇒ Object
269 270 271 |
# File 'lib/lazop_api_client.rb', line 269 def header_params @header_params end |
#http_method ⇒ Object
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 (value) @timestamp = value end |
#timestamp ⇒ Object
245 246 247 |
# File 'lib/lazop_api_client.rb', line 245 def @timestamp end |