Skip to content

Commit

Permalink
Make MiniKickstarter constants private.
Browse files Browse the repository at this point in the history
  • Loading branch information
thirdtruck committed Aug 25, 2016
1 parent 7c5e58d commit 9ebf58f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/mini_kickstarter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
class MiniKickstarter
include CreditCard

# TODO: Move checks into the option parser. Take only pre-vetted input.
NUMERIC = /\A[0-9]+\z/
ALPHANUMERIC_WITH_UNDERSCORES_DASHES = /\A[[:alnum:]_-]*[[:alnum:]]+[[:alnum:]_-]*\z/
JUST_DOLLARS_AND_CENTS = /\A(0|[1-9][0-9]*|([1-9][0-9]*|[0-9])\.[0-9]{2})\z/

def invoke(db, command_name, command_params)
# TODO: Compile all errors before reporting instead of reporting only the first match. Better UX.
case command_name
Expand All @@ -29,6 +24,11 @@ class InvalidCommandParameterError < StandardError

private

# TODO: Move checks into the option parser. Take only pre-vetted input.
NUMERIC = /\A[0-9]+\z/
ALPHANUMERIC_WITH_UNDERSCORES_DASHES = /\A[[:alnum:]_-]*[[:alnum:]]+[[:alnum:]_-]*\z/
JUST_DOLLARS_AND_CENTS = /\A(0|[1-9][0-9]*|([1-9][0-9]*|[0-9])\.[0-9]{2})\z/

def invoke_project(db, command_params)
project_name = command_params[:project_name]
target_dollar_amount = command_params[:target_dollar_amount]
Expand Down

0 comments on commit 9ebf58f

Please sign in to comment.