lib/idonethis/use_cases/new.rb in idonethis-cli-0.6.0 vs lib/idonethis/use_cases/new.rb in idonethis-cli-0.7.0
- old
+ new
@@ -1,25 +1,25 @@
-module Idonethis::UseCases
- module New
- class << self
- def apply(credential, args={})
- log = args[:log] || fail("You need to supply :internet adapter")
- internet = args[:internet] || fail("You need to supply :internet adapter")
-
- log.call "args: #{args}"
-
- parse internet.post(
- Idonethis::Index.dones,
- { "Authorization" => "Token #{credential[:token]}", accept: "application/json"},
- { "raw_text" => args[:message], "team" => credential[:team]})
- end
-
- private
-
- def parse(reply)
- require 'json'
-
- JSON.parse(reply.body)
- end
- end
- end
+module Idonethis::UseCases
+ module New
+ class << self
+ def apply(credential, args={})
+ log = args[:log] || fail("You need to supply :internet adapter")
+ internet = args[:internet] || fail("You need to supply :internet adapter")
+
+ log.call "args: #{args}"
+
+ parse internet.post(
+ Idonethis::Index.dones,
+ { "Authorization" => "Token #{credential[:token]}", accept: "application/json"},
+ { "raw_text" => args[:message], "team" => credential[:team]})
+ end
+
+ private
+
+ def parse(reply)
+ require 'json'
+
+ JSON.parse(reply.body)
+ end
+ end
+ end
end
\ No newline at end of file