Module: GoogleHelpers

Instance Method Summary collapse

Instance Method Details

#update_attributes(attributes) ⇒ Object



8
9
10
11
12
# File 'lib/google_helpers.rb', line 8

def update_attributes(attributes)
  attributes.each do |k, v|
    self.send("#{k}=".to_sym, (v.kind_of? Time)? v.to_joda_time : v)
  end
end

#url_for(url_or_string) ⇒ Object



4
5
6
# File 'lib/google_helpers.rb', line 4

def url_for(url_or_string)
  (url_or_string.kind_of? String) ? URL.new(url_or_string) : url_or_string
end