Class: TokyoApi::Base

Inherits:
Vertebrae::Model
  • Object
show all
Defined in:
lib/tokyo_api/base.rb

Direct Known Subclasses

Actionkit, Campact, Expire, ExternalImage, Identity

Instance Method Summary collapse

Instance Method Details

#normalized_base_pathObject



5
6
7
# File 'lib/tokyo_api/base.rb', line 5

def normalized_base_path
  "#{base_path}/"
end

#required_fields_param(required_fields) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/tokyo_api/base.rb', line 13

def required_fields_param(required_fields)
  if required_fields.present?
    "required_fields=#{required_fields.collect { |v| url_escape(v.to_s) }.join(',')}"
  else
    ''
  end
end

#url_escape(string) ⇒ Object



9
10
11
# File 'lib/tokyo_api/base.rb', line 9

def url_escape(string)
  CGI.escape(string.to_s)
end