Class: HatenaGroup::Calendar::Keyword

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

Instance Method Summary collapse

Constructor Details

#initialize(agent, group, keyword) ⇒ Keyword

Returns a new instance of Keyword.



39
40
41
42
43
# File 'lib/hatenagroup/calendar.rb', line 39

def initialize(agent, group, keyword)
  @agent = agent
  @group = group
  @keyword = keyword
end

Instance Method Details

#bodyObject



45
46
47
# File 'lib/hatenagroup/calendar.rb', line 45

def body
  agent.get(read_url).form_with(:name => 'edit', :action => '/keyword').field_with(:name => 'body').value
end

#body=(s) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/hatenagroup/calendar.rb', line 49

def body=(s)
  agent.get(edit_url).form_with(:name => 'edit', :action => '/keyword') do |form|
    next unless form
    form['body'] = s
    form.submit
  end
end