class ScriptedClient::Pitch

Public Class Methods

find(*arguments) click to toggle source
Calls superclass method
# File lib/scripted_client/pitch.rb, line 3
def self.find(*arguments)
  if arguments.first.kind_of?(String)
    options = arguments[1]
    unless options.kind_of?(Hash) &&
      options[:params].kind_of?(Hash) &&
      options[:params].key?(:pitchset_id)
      fail "You must pass both a pitchset_id and an id to #{ name }#find. For example: \n
        #{ name }.find('#{ arguments.first }', params: { pitchset_id: 'abc123' }) \n\n\n"
    end
  end
  super
end
setup_prefix() click to toggle source
# File lib/scripted_client/pitch.rb, line 16
def self.setup_prefix
  self.prefix = "#{ prefix }pitchsets/:pitchset_id/"
end

Public Instance Methods

accept(feedback = nil) click to toggle source
# File lib/scripted_client/pitch.rb, line 20
def accept(feedback = nil)
  set_pitchset_prefix
  post(:accept, {}, { feedback: feedback }.to_json)
end
reject(feedback = nil) click to toggle source
# File lib/scripted_client/pitch.rb, line 25
def reject(feedback = nil)
  set_pitchset_prefix
  post(:reject, {}, { feedback: feedback }.to_json)
end

Private Instance Methods

set_pitchset_prefix() click to toggle source
# File lib/scripted_client/pitch.rb, line 32
def set_pitchset_prefix
  self.prefix_options[:pitchset_id] = pitchset.id
end