class SlackProgress::OptionsParser

Public Class Methods

new(options = {}) click to toggle source
# File lib/slack-progress/options_parser.rb, line 4
def initialize(options = {})
  @options = options
end

Public Instance Methods

parse() click to toggle source
# File lib/slack-progress/options_parser.rb, line 8
def parse
  OpenStruct.new(
    app_options: app_options,
    formatting_options: formatting_options,
  )
end

Private Instance Methods

app_options() click to toggle source
# File lib/slack-progress/options_parser.rb, line 17
def app_options
  OpenStruct.new(
    # username: username,
    # icon_emoji: icon_emoji,
  )
end
completed_filler() click to toggle source
# File lib/slack-progress/options_parser.rb, line 36
def completed_filler
  @options[:completed_filler] || ':black_medium_square:'
end
formatting_options() click to toggle source
# File lib/slack-progress/options_parser.rb, line 24
def formatting_options
  OpenStruct.new(
    remaining_filler: remaining_filler,
    completed_filler: completed_filler,
    title: title,
  )
end
remaining_filler() click to toggle source
# File lib/slack-progress/options_parser.rb, line 32
def remaining_filler
  @options[:remaining_filler] || ':white_medium_square:'
end
title() click to toggle source
# File lib/slack-progress/options_parser.rb, line 40
def title
  @options[:title] || ''
end