Class: Achoo::Achievo::LockMonthForm

Inherits:
Object
  • Object
show all
Defined in:
lib/achoo/achievo/lock_month_form.rb

Instance Method Summary collapse

Constructor Details

#initialize(agent) ⇒ LockMonthForm

Returns a new instance of LockMonthForm.



7
8
9
# File 'lib/achoo/achievo/lock_month_form.rb', line 7

def initialize(agent)
  @agent = agent
end

Instance Method Details

#lock_month(period) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/achoo/achievo/lock_month_form.rb', line 11

def lock_month(period)
  page  = @agent.get(RC[:lock_months_url])
  @form  = page.form('entryform')

  @form.period = period
  unless user_select.nil?
    user_select.options.each do |opt|
      if opt.text.match(/\(#{RC[:user]}\)$/)
        opt.select
      end
    end
  end

end


26
27
28
29
30
# File 'lib/achoo/achievo/lock_month_form.rb', line 26

def print_values
  puts "Month: #{@form.period}"
  puts " User: #{user_select.value}" unless user_select.nil?

end

#submitObject



32
33
34
# File 'lib/achoo/achievo/lock_month_form.rb', line 32

def submit
  @form.submit
end