Class: Users
- Inherits:
-
Object
- Object
- Users
- Defined in:
- lib/users.rb
Instance Method Summary collapse
- #add(options) ⇒ Object
- #add_complete(options) ⇒ Object
- #add_payment(options) ⇒ Object
- #add_with_location(options) ⇒ Object
- #authenticate ⇒ Object
- #change_credit(amount, description, targetUsername, getTax) ⇒ Object
- #execute(method, data) ⇒ Object
- #forgot_password(mobileNumber, emailAddress, targetUsername) ⇒ Object
- #get ⇒ Object
- #get_base_price(targetUsername) ⇒ Object
- #get_cities(provinceId) ⇒ Object
- #get_credit(targetUsername) ⇒ Object
- #get_data ⇒ Object
- #get_details(targetUsername) ⇒ Object
- #get_expire_date ⇒ Object
- #get_numbers ⇒ Object
- #get_provinces ⇒ Object
- #get_transactions(targetUsername, creditType, dateFrom, dateTo, keyword) ⇒ Object
- #has_filter(text) ⇒ Object
-
#initialize(username, password) ⇒ Users
constructor
A new instance of Users.
- #remove(targetUsername) ⇒ Object
Constructor Details
#initialize(username, password) ⇒ Users
4 5 6 7 8 |
# File 'lib/users.rb', line 4 def initialize(username, password) @username = username @password = password @client = Savon.client(wsdl: "http://api.payamak-panel.com/post/users.asmx?wsdl") end |
Instance Method Details
#add(options) ⇒ Object
22 23 24 |
# File 'lib/users.rb', line 22 def add() execute(:add_user,) end |
#add_complete(options) ⇒ Object
25 26 27 |
# File 'lib/users.rb', line 25 def add_complete() execute(:add_user_complete,) end |
#add_payment(options) ⇒ Object
19 20 21 |
# File 'lib/users.rb', line 19 def add_payment() execute(:add_payment,) end |
#add_with_location(options) ⇒ Object
28 29 30 |
# File 'lib/users.rb', line 28 def add_with_location() execute(:add_user_with_location,) end |
#authenticate ⇒ Object
31 32 33 |
# File 'lib/users.rb', line 31 def authenticate execute(:authenticate_user,{}) end |
#change_credit(amount, description, targetUsername, getTax) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/users.rb', line 34 def change_credit(amount, description, targetUsername, getTax) execute(:change_user_credit,{ :amount => amount, :description => description, :targetUsername => targetUsername, :GetTax => getTax }) end |
#execute(method, data) ⇒ Object
15 16 17 18 |
# File 'lib/users.rb', line 15 def execute(method,data) response = @client.call(method, message:data.merge(get_data)) response.body end |
#forgot_password(mobileNumber, emailAddress, targetUsername) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/users.rb', line 43 def forgot_password(mobileNumber, emailAddress, targetUsername) execute(:forgot_password,{ :mobileNumber => mobileNumber, :emailAddress => emailAddress, :targetUsername => targetUsername }) end |
#get ⇒ Object
93 94 95 |
# File 'lib/users.rb', line 93 def get execute(:get_users,{}) end |
#get_base_price(targetUsername) ⇒ Object
50 51 52 53 54 |
# File 'lib/users.rb', line 50 def get_base_price(targetUsername) execute(:get_user_base_price,{ :targetUsername => targetUsername }) end |
#get_cities(provinceId) ⇒ Object
76 77 78 79 80 |
# File 'lib/users.rb', line 76 def get_cities(provinceId) execute(:get_cities,{ :provinceId => provinceId }) end |
#get_credit(targetUsername) ⇒ Object
60 61 62 63 64 |
# File 'lib/users.rb', line 60 def get_credit(targetUsername) execute(:get_user_credit,{ :targetUsername => targetUsername }) end |
#get_data ⇒ Object
9 10 11 12 13 14 |
# File 'lib/users.rb', line 9 def get_data { :username => @username, :password => @password } end |
#get_details(targetUsername) ⇒ Object
65 66 67 68 69 |
# File 'lib/users.rb', line 65 def get_details(targetUsername) execute(:get_user_details,{ :targetUsername => targetUsername }) end |
#get_expire_date ⇒ Object
81 82 83 |
# File 'lib/users.rb', line 81 def get_expire_date execute(:get_expire_date,{}) end |
#get_numbers ⇒ Object
70 71 72 |
# File 'lib/users.rb', line 70 def get_numbers execute(:get_user_numbers,{}) end |
#get_provinces ⇒ Object
73 74 75 |
# File 'lib/users.rb', line 73 def get_provinces execute(:get_provinces,{}) end |
#get_transactions(targetUsername, creditType, dateFrom, dateTo, keyword) ⇒ Object
84 85 86 87 88 89 90 91 92 |
# File 'lib/users.rb', line 84 def get_transactions(targetUsername, creditType, dateFrom, dateTo, keyword) execute(:get_user_transactions,{ :creditType => creditType, :dateFrom => dateFrom, :targetUsername => targetUsername, :dateTo => dateTo, :keyword => keyword }) end |
#has_filter(text) ⇒ Object
96 97 98 99 100 |
# File 'lib/users.rb', line 96 def has_filter(text) execute(:has_filter,{ :text => text }) end |
#remove(targetUsername) ⇒ Object
55 56 57 58 59 |
# File 'lib/users.rb', line 55 def remove(targetUsername) execute(:remove_user,{ :targetUsername => targetUsername }) end |