class Ticket
Public Class Methods
new(username, password)
click to toggle source
# File lib/ticket.rb, line 4 def initialize(username, password) @username = username @password = password @client = Savon.client(wsdl: "http://api.payamak-panel.com/post/Tickets.asmx?wsdl") end
Public Instance Methods
add(title, content, aws=true)
click to toggle source
# File lib/ticket.rb, line 19 def add(title, content, aws=true) execute(:add_ticket,{ :title => title, :content => content, :alertWithSms => alertWithSms }) end
execute(method,data)
click to toggle source
# File lib/ticket.rb, line 15 def execute(method,data) response = @client.call(method, message:data.merge(get_data)) response.body end
get_data()
click to toggle source
# File lib/ticket.rb, line 9 def get_data { :username => @username, :password => @password } end
get_received(ticketOwner, ticketType, keyword)
click to toggle source
# File lib/ticket.rb, line 26 def get_received(ticketOwner, ticketType, keyword) execute(:get_received_tickets,{ :ticketOwner => ticketOwner, :ticketType => ticketType, :keyword => keyword }) end
get_received_count(ticketType)
click to toggle source
# File lib/ticket.rb, line 33 def get_received_count(ticketType) execute(:get_received_tickets_count,{ :ticketType => ticketType }) end
get_sent(ticketOwner, ticketType, keyword)
click to toggle source
# File lib/ticket.rb, line 38 def get_sent(ticketOwner, ticketType, keyword) execute(:get_sent_tickets,{ :ticketOwner => ticketOwner, :ticketType => ticketType, :keyword => keyword }) end
get_sent_count(ticketType)
click to toggle source
# File lib/ticket.rb, line 45 def get_sent_count(ticketType) execute(:get_sent_tickets_count,{ :ticketType => ticketType }) end
response(ticketId, type, content, alertWithSms=true)
click to toggle source
# File lib/ticket.rb, line 50 def response(ticketId, type, content, alertWithSms=true) execute(:response_ticket,{ :ticketId => ticketId, :content => content, :alertWithSms => alertWithSms, :type => type }) end