Class: Bishl::ParamsBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/params_builder.rb

Class Method Summary collapse

Class Method Details

Raises:



7
8
9
10
11
12
13
14
15
16
# File 'lib/params_builder.rb', line 7

def build_link(options={})
  raise OptionsNotMetError, "season missing" unless options.has_key?(:season)
  raise OptionsNotMetError, "league missing" unless options.has_key?(:cs)

  url = "?season=#{options[:season]}&cs=#{options[:cs]}"
  if options.has_key?(:team)
    url = "#{url}&team=#{options[:team]}"
  end
  return url
end