Class: Achoo::LockMonthForm

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

Instance Method Summary collapse

Constructor Details

#initialize(agent) ⇒ LockMonthForm

Returns a new instance of LockMonthForm.

[View source]

5
6
7
# File 'lib/achoo/lock_month_form.rb', line 5

def initialize(agent)
  @agent = agent
end

Instance Method Details

#lock_month(period) ⇒ Object

[View source]

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

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
[View source]

24
25
26
27
28
# File 'lib/achoo/lock_month_form.rb', line 24

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

end

#submitObject

[View source]

30
31
32
# File 'lib/achoo/lock_month_form.rb', line 30

def submit
  @form.submit
end