lib/idonethis/use_cases/new.rb in idonethis-cli-0.12.0 vs lib/idonethis/use_cases/new.rb in idonethis-cli-0.13.0

- old
+ new

@@ -1,29 +1,29 @@ -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") - team = args[:team] - - log.call "args: #{args}" - log.call "overriding team <#{credential[:team]}> with <#{team}>" - - parse internet.post( - Idonethis::Index.dones, - { "Authorization" => "Token #{credential[:token]}", accept: "application/json"}, - { - "raw_text" => args[:message], - "team" => (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") + team = args[:team] + + log.call "args: #{args}" + log.call "overriding team <#{credential[:team]}> with <#{team}>" + + parse internet.post( + Idonethis::Index.dones, + { "Authorization" => "Token #{credential[:token]}", accept: "application/json"}, + { + "raw_text" => args[:message], + "team" => (team || credential[:team])}) + end + + private + + def parse(reply) + require 'json' + + JSON.parse(reply.body) + end + end + end end \ No newline at end of file