Class: Mpayer::Message

Inherits:
Endpoint show all
Defined in:
lib/mpayer_ruby/endpoints/message.rb

Instance Attribute Summary

Attributes inherited from Endpoint

#attributes, #config, #endpoint, #id, #pagination, #response

Class Method Summary collapse

Methods inherited from Endpoint

#initialize, #success?

Constructor Details

This class inherits a constructor from Mpayer::Endpoint

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mpayer::Endpoint

Class Method Details

.create(options = {}) ⇒ Object

message_attributes = ‘Please send me a message’, destination:‘0722737343,343843843’ Mpayer::Message.create(message_attributes)



7
8
9
10
11
# File 'lib/mpayer_ruby/endpoints/message.rb', line 7

def create(options={})
	url = "/messages"
	response = Mpayer::Fetch.post(url,options)
	message = new(options.merge!(id:response.id ,response:response)) rescue response
end