Class: PortaText::Command::Api::Cnam
- Defined in:
- lib/portatext/command/api/cnam.rb
Overview
The cnam endpoint. github.com/PortaText/docs/wiki/REST-API#api_cnam
- Author
-
Marcelo Gornstein ([email protected])
- Copyright
-
Copyright © 2015 PortaText
- License
-
Apache-2.0
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#accept_content_type, #body, #content_type, #delete, #get, #initialize, #patch, #post, #put, #set
Constructor Details
This class inherits a constructor from PortaText::Command::Base
Instance Method Details
#csv(file) ⇒ Object
15 16 17 |
# File 'lib/portatext/command/api/cnam.rb', line 15 def csv(file) set :file, file end |
#endpoint(_method) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/portatext/command/api/cnam.rb', line 19 def endpoint(_method) error = @args[:number].nil? && @args[:file].nil? raise 'DID number cant be null' if error number = @args[:number] @args.delete :number return "cnam/#{number}" unless number.nil? 'cnam' end |
#for_number(number) ⇒ Object
11 12 13 |
# File 'lib/portatext/command/api/cnam.rb', line 11 def for_number(number) set :number, number end |