Class: ContextIO::SourceCollection
- Inherits:
-
Object
- Object
- ContextIO::SourceCollection
- Includes:
- API::ResourceCollection
- Defined in:
- lib/contextio/source_collection.rb
Instance Attribute Summary
Attributes included from API::ResourceCollection
#resource_url, #where_constraints
Instance Method Summary collapse
-
#create(email, server, username, use_ssl, port, type, options = {}) ⇒ Object
Creates a new source for an account.
Methods included from API::ResourceCollection
#[], #each, #empty?, #size, #where
Instance Method Details
#create(email, server, username, use_ssl, port, type, options = {}) ⇒ Object
Creates a new source for an account.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/contextio/source_collection.rb', line 25 def create(email, server, username, use_ssl, port, type, ={}) api_args = .merge( :email => email, :server => server, :username => username, :use_ssl => use_ssl ? '1' : '0', :port => port.to_s, :type => type ) result_hash = api.request(:post, resource_url, api_args) result_hash.delete('success') resource_class.new(api, result_hash) end |