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.



154
155
156
157
158
159
# File 'lib/lazop_api_client.rb', line 154

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



161
162
163
164
165
166
167
# File 'lib/lazop_api_client.rb', line 161

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



178
179
180
181
182
183
184
# File 'lib/lazop_api_client.rb', line 178

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



169
170
171
172
173
174
175
# File 'lib/lazop_api_client.rb', line 169

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



198
199
200
# File 'lib/lazop_api_client.rb', line 198

def api_name
    @api_name
end

#api_paramsObject



194
195
196
# File 'lib/lazop_api_client.rb', line 194

def api_params
    @api_params
end

#file_paramsObject



206
207
208
# File 'lib/lazop_api_client.rb', line 206

def file_params
    @file_params
end

#header_paramsObject



210
211
212
# File 'lib/lazop_api_client.rb', line 210

def header_params
    @header_params
end

#http_methodObject



202
203
204
# File 'lib/lazop_api_client.rb', line 202

def http_method
    @http_method
end

#set_timestamp=(value) ⇒ Object



190
191
192
# File 'lib/lazop_api_client.rb', line 190

def set_timestamp=(value)
    @timestamp = value
end

#timestampObject



186
187
188
# File 'lib/lazop_api_client.rb', line 186

def timestamp
    @timestamp
end