class QingCloudServer::Client::ServiceFoudation
Attributes
response[RW]
Public Class Methods
new(connector)
click to toggle source
# File lib/client/service_foundation.rb, line 15 def initialize(connector) @connector = connector end
Public Instance Methods
fetch_response(action, params)
click to toggle source
# File lib/client/service_foundation.rb, line 19 def fetch_response(action, params) params.each do |k, v| params.delete(k) unless (v.is_a?(Numeric)) || (v && v.length > 0) end self.response = @connector.fetch_server_condition(action, params) end
make_action_and_params()
click to toggle source
def convert_arr_to_hash(arr)
hash = {} arr.each {|h| hash.merge!(h)} hash
end
# File lib/client/service_foundation.rb, line 33 def make_action_and_params " fetch_response( __method__.to_s.split('_').map {|e| e.capitalize!}.join, method(__method__).parameters.map { |_, p| {p.to_sym => eval(p.to_s)} }.arr_to_hsh ) " end