Sha256: 49cc4cc46bc332d2086ee985bd6bd20e595d9e22a0bb6f462f2cdc0d649414c0
Contents?: true
Size: 782 Bytes
Versions: 21
Compression:
Stored size: 782 Bytes
Contents
class Zendesk2::Client::CreateTopic < Zendesk2::Client::Request request_method :post request_body { |r| { "topic" => r.topic_params } } request_path { |_| "/topics.json" } def self.accepted_attributes %w[title body submitter_id updater_id forum_id locked pinned highlighted position tags] end def topic_params @_topic_params ||= Cistern::Hash.slice(params.fetch("topic"), *self.class.accepted_attributes) end def mock identity = service.serial_id record = { "id" => identity, "url" => url_for("/topics/#{identity}.json"), "created_at" => Time.now.iso8601, "updated_at" => Time.now.iso8601, }.merge(topic_params) self.data[:topics][identity] = record mock_response("topic" => record) end end
Version data entries
21 entries across 21 versions & 1 rubygems