Class: Achoo::LockMonthForm
- Inherits:
-
Object
- Object
- Achoo::LockMonthForm
- Defined in:
- lib/achoo/lock_month_form.rb
Instance Method Summary collapse
-
#initialize(agent) ⇒ LockMonthForm
constructor
A new instance of LockMonthForm.
- #lock_month(period) ⇒ Object
- #print_values ⇒ Object
- #submit ⇒ Object
Constructor Details
permalink #initialize(agent) ⇒ LockMonthForm
Returns a new instance of LockMonthForm.
5 6 7 |
# File 'lib/achoo/lock_month_form.rb', line 5 def initialize(agent) @agent = agent end |
Instance Method Details
permalink #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..each do |opt| if opt.text.match(/\(#{RC[:user]}\)$/) opt.select end end end end |
permalink #print_values ⇒ Object
[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 |
permalink #submit ⇒ Object
[View source]
30 31 32 |
# File 'lib/achoo/lock_month_form.rb', line 30 def submit @form.submit end |