Class: Pfapi::PageformantAPI
- Inherits:
-
Object
- Object
- Pfapi::PageformantAPI
- Defined in:
- lib/pfapi.rb
Instance Attribute Summary collapse
-
#lastError ⇒ Object
Returns the value of attribute lastError.
Instance Method Summary collapse
-
#initialize(key, passwd) ⇒ PageformantAPI
constructor
A new instance of PageformantAPI.
- #sendMessage(srvID, message, link, userSpecID = nil) ⇒ Object
Constructor Details
#initialize(key, passwd) ⇒ PageformantAPI
Returns a new instance of PageformantAPI.
21 22 23 24 25 26 27 |
# File 'lib/pfapi.rb', line 21 def initialize(key, passwd) @apiKey = key @apiPasswd = passwd @lastError = nil self end |
Instance Attribute Details
#lastError ⇒ Object
Returns the value of attribute lastError.
19 20 21 |
# File 'lib/pfapi.rb', line 19 def lastError @lastError end |
Instance Method Details
#sendMessage(srvID, message, link, userSpecID = nil) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/pfapi.rb', line 29 def sendMessage(srvID, , link, userSpecID = nil) @lastError = nil params = defaultParams params['METHOD'] = 'PostMessage' params['SERVICEID'] = srvID.to_s params['MESSAGE'] = params['LINK'] = link params['USERSPECID'] = if userSpecID.nil? '' else userSpecID.to_s end begin sendAPIRequest(params) rescue => err @lastError = PageformantException.new(err.) end @lastError.nil? end |