mirror of
https://github.com/mistergibson/gxg-web-client.git
synced 2026-08-15 03:26:00 -07:00
Added download_file
This commit is contained in:
parent
d09194635d
commit
7dd91a2018
1 changed files with 13 additions and 8 deletions
|
|
@ -232,6 +232,17 @@ module GxG
|
||||||
#
|
#
|
||||||
end
|
end
|
||||||
#
|
#
|
||||||
|
def download_file(the_vfs_path="", error_handler=nil, &the_handler)
|
||||||
|
if self.open?
|
||||||
|
if the_vfs_path.is_a?(::String) && the_handler
|
||||||
|
self.pull_data({:download_file => {:path => the_vfs_path}},error_handler, &the_handler)
|
||||||
|
true
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
#
|
||||||
def push(the_message=nil, options={})
|
def push(the_message=nil, options={})
|
||||||
if @active
|
if @active
|
||||||
# Uses PUT method, with data payload
|
# Uses PUT method, with data payload
|
||||||
|
|
@ -353,11 +364,7 @@ module GxG
|
||||||
# FOR NOW: limit 100 records returned at a time.
|
# FOR NOW: limit 100 records returned at a time.
|
||||||
# Use: {:limit => 100, :offset => 0} || {:page => 1}
|
# Use: {:limit => 100, :offset => 0} || {:page => 1}
|
||||||
if details.is_a?(::Hash) && the_handler
|
if details.is_a?(::Hash) && the_handler
|
||||||
self.pull_data({:search_database => {:criteria => details}},error_handler) do |data|
|
self.pull_data({:search_database => {:criteria => details}},error_handler, &the_handler)
|
||||||
if data.is_a?(::Hash)
|
|
||||||
the_handler.call(data)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
|
@ -708,9 +715,7 @@ module GxG
|
||||||
def call_event(service=:core, op_frame={:interface => true}, error_handler=nil, &the_handler)
|
def call_event(service=:core, op_frame={:interface => true}, error_handler=nil, &the_handler)
|
||||||
if self.open?
|
if self.open?
|
||||||
if op_frame.is_a?(::Hash) && the_handler
|
if op_frame.is_a?(::Hash) && the_handler
|
||||||
self.pull_data({:call_event => {:service => service.to_s, :op_frame => op_frame}},error_handler) do |data|
|
self.pull_data({:call_event => {:service => service.to_s, :op_frame => op_frame}}, error_handler, &the_handler)
|
||||||
the_handler.call(data)
|
|
||||||
end
|
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue