lib/slack/message.rb in fde-slack-notification-0.1.0 vs lib/slack/message.rb in fde-slack-notification-0.2.0
- old
+ new
@@ -11,15 +11,21 @@
:author,
:fields,
:footer,
:color
- def initialize(title, fields, author = nil, footer = nil, username = nil)
- @username = username || 'FDE Slack Notifier'
+ def initialize(title, fields, options = {})
@title = title
- @author = author
@fields = fields
- @footer = footer
+ if options[:username]
+ @username = options[:username] || 'FDE Slack Notifier'
+ end
+ if options[:author]
+ @author = options[:author]
+ end
+ if options[:footer]
+ @footer = options[:footer]
+ end
end
def info(channel)
@color = BLUE
send(channel)