Class: GcalButton

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

Constant Summary collapse

GCAL_TIME_FORMAT =
"%Y%m%dT%H%M%SZ"
GCAL_DATE_FORMAT =
"%Y%m%d"
BASE_URL =
"http://www.google.com/calendar/event"
IMAGE_URLS =
{
  default: "http://www.google.com/calendar/images/ext/gc_button1.gif",
  remind_me: "http://www.google.com/calendar/images/ext/gc_button2.gif",
  add_to: "http://www.google.com/calendar/images/ext/gc_button6.gif",
  large: "http://www.google.com/calendar/images/ext/gc_button6.gif"
}

Instance Method Summary collapse

Constructor Details

#initialize(title, start_time, end_time, sprops = {}) ⇒ GcalButton

Returns a new instance of GcalButton.



15
16
17
18
19
20
# File 'lib/gcal_button.rb', line 15

def initialize(title, start_time, end_time, sprops={})
  @title = title
  @start_time = start_time
  @end_time = end_time
  @sprops = sprops
end

Instance Method Details

#image_url(type = :default) ⇒ Object



26
27
28
# File 'lib/gcal_button.rb', line 26

def image_url(type=:default)
  IMAGE_URLS[type]
end

#urlObject



22
23
24
# File 'lib/gcal_button.rb', line 22

def url
  "#{BASE_URL}?#{query_params}"
end