Class: Cubaru::V1::Postcard::Resource
- Inherits:
-
Object
- Object
- Cubaru::V1::Postcard::Resource
- Defined in:
- lib/cubaru/v1/postcard/resource.rb
Instance Method Summary collapse
- #create(options = {}) ⇒ Object
- #find(postcard_id) ⇒ Object
-
#initialize(resource) ⇒ Resource
constructor
A new instance of Resource.
- #list(options = {}) ⇒ Object
Constructor Details
#initialize(resource) ⇒ Resource
Returns a new instance of Resource.
6 7 8 |
# File 'lib/cubaru/v1/postcard/resource.rb', line 6 def initialize(resource) @resource = resource end |
Instance Method Details
#create(options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cubaru/v1/postcard/resource.rb', line 18 def create( = {}) if [:to] && ![:to].is_a?(String) [:to] = @resource.format_address_params([:to]) end if [:from] && ![:from].is_a?(String) [:from] = @resource.format_address_params([:from]) end Cubaru.submit :post, postcard_url, end |