class PlateApi::Connector
Public Class Methods
new(public_key, secret_key, custom_server=nil)
click to toggle source
# File lib/plate_api/connector.rb, line 4 def initialize(public_key, secret_key, custom_server=nil) @custom_server = custom_server @public_key = public_key @secret_key = secret_key @handling_classes = {} end
plate_object_classes()
click to toggle source
# File lib/plate_api/connector.rb, line 35 def self.plate_object_classes { sites: PlateApi::PlateObject::Site, partners: PlateApi::PlateObject::Partner, companies: PlateApi::PlateObject::Company, themes: PlateApi::PlateObject::Theme, site_translations: PlateApi::PlateObject::SiteTranslation, posts: PlateApi::PlateObject::Post, sections: PlateApi::PlateObject::Section, rows: PlateApi::PlateObject::Row, columns: PlateApi::PlateObject::Column, elements: PlateApi::PlateObject::Element, content_objects: PlateApi::PlateObject::ContentObject, attachments: PlateApi::PlateObject::Attachment } end
Public Instance Methods
delete(url="", parameters={}, response_type=:json)
click to toggle source
# File lib/plate_api/connector.rb, line 15 def delete(url="", parameters={}, response_type=:json) DeleteRequest.new(@public_key, @secret_key, url, parameters, @custom_server).execute(response_type) end
get(url="", parameters={}, response_type=:json)
click to toggle source
# File lib/plate_api/connector.rb, line 11 def get(url="", parameters={}, response_type=:json) GetRequest.new(@public_key, @secret_key, url, parameters, @custom_server).execute(response_type) end
handler(handled_class)
click to toggle source
# File lib/plate_api/connector.rb, line 31 def handler(handled_class) @handling_classes[handled_class] ||= ObjectHandler.new(handled_class, self) end
post(url="", post_params={}, response_type=:json)
click to toggle source
# File lib/plate_api/connector.rb, line 23 def post(url="", post_params={}, response_type=:json) PostRequest.new(@public_key, @secret_key, url, post_params, @custom_server).execute(response_type) end
post_multipart(url="", post_params={}, response_type=:json)
click to toggle source
# File lib/plate_api/connector.rb, line 27 def post_multipart(url="", post_params={}, response_type=:json) PostMultipartRequest.new(@public_key, @secret_key, url, post_params, @custom_server).execute(response_type) end
put(url="", put_params={}, response_type=:json)
click to toggle source
# File lib/plate_api/connector.rb, line 19 def put(url="", put_params={}, response_type=:json) PutRequest.new(@public_key, @secret_key, url, put_params, @custom_server).execute(response_type) end