class Capistrano::Dingtalk::Messaging::Base

Public Class Methods

new(info) click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 11
def initialize(info)
  @info = info || {}
end

Public Instance Methods

build_at_dict() click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 42
def build_at_dict
  at = {}
  at["at"] = @info[:at_all]
  at["atMobiles"] = @info[:at_mobiles]
  at
end
build_hash(action) click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 49
def build_hash(action)
  # implements on children
end
build_msg_json(action) click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 53
def build_msg_json(action)
  build_hash(action).merge(build_at_dict).to_json
end
message_for(action) click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 37
def message_for(action)
  method = "message_for_#{action}"
  respond_to?(method) && send(method)
end
message_for_failed() click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 31
def message_for_failed
  "#{deployer} has failed to #{deploying? ? 'deploy' : 'rollback'} branch #{branch} of #{application} to #{stage}"
end
message_for_reverted() click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 27
def message_for_reverted
  "#{deployer} has finished rolling back branch of #{application} to #{stage}"
end
message_for_reverting() click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 19
def message_for_reverting
  "#{deployer} has started rolling back branch #{branch} of #{application} to #{stage}"
end
message_for_updated() click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 23
def message_for_updated
  "#{deployer} has finished deploying branch #{branch} of #{application} to #{stage}"
end
message_for_updating() click to toggle source
# File lib/capistrano/dingtalk/messaging/base.rb, line 15
def message_for_updating
  "#{deployer} has started deploying branch #{branch} of #{application} to #{stage}"
end