Class: CoopCli::Coop
Instance Method Summary collapse
- #basic_auth(user, pass) ⇒ Object
-
#initialize(base_uri) ⇒ Coop
constructor
A new instance of Coop.
- #post_as_cobot(path, message, cobotkey) ⇒ Object
- #post_as_user(path, message) ⇒ Object
- #user_agent ⇒ Object
Constructor Details
#initialize(base_uri) ⇒ Coop
Returns a new instance of Coop.
10 11 12 |
# File 'lib/coop_cli.rb', line 10 def initialize(base_uri) self.class.base_uri base_uri end |
Instance Method Details
#basic_auth(user, pass) ⇒ Object
14 15 16 |
# File 'lib/coop_cli.rb', line 14 def basic_auth(user,pass) self.class.basic_auth user, pass end |
#post_as_cobot(path, message, cobotkey) ⇒ Object
26 27 28 29 |
# File 'lib/coop_cli.rb', line 26 def post_as_cobot(path,,cobotkey) self.class.post(path, :query => { :status => , :key => cobotkey }, :headers => { "User-Agent" => self.user_agent, "Accept" => "application/json", "Content-Type" => "application/json; charset=utf-8" }) end |
#post_as_user(path, message) ⇒ Object
22 23 24 |
# File 'lib/coop_cli.rb', line 22 def post_as_user(path,) self.class.post(path, :query => { :status => }, :headers => { "User-Agent" => self.user_agent }) end |