Module: FoundationApi::Request::ClassMethods

Defined in:
lib/foundation_api/request.rb

Instance Method Summary collapse

Instance Method Details

#generate_event(type, params = {}) ⇒ Object



8
9
10
# File 'lib/foundation_api/request.rb', line 8

def generate_event(type, params = {})
  FoundationApi::Event::Client.request :generate_event, {:type => type, :fields => params}
end

#quote(arg) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/foundation_api/request.rb', line 12

def quote(arg)
  case arg
  when String, Symbol, Date
    "'#{arg}'"
  when Array
    arg.collect { |e| quote(e)  }.join(', ')
  else
    arg.to_s
  end
end