Class: Mite::TimeEntry::Bookmark

Inherits:
Base
  • Object
show all
Includes:
ResourceWithoutWriteAccess
Defined in:
lib/mite/time_entry/bookmark.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ResourceWithoutWriteAccess

#create, #destroy, #save

Methods inherited from Base

all, first, inherited, last

Class Method Details

.follow(id) ⇒ Object



23
24
25
26
27
28
# File 'lib/mite/time_entry/bookmark.rb', line 23

def follow(id)
  get("#{id}/follow")
rescue ActiveResource::Redirection => err
  query = err.response['Location'].split(/\?/,2)[1] || ""
  new(:query => query).follow
end

Instance Method Details

#followObject



18
19
20
# File 'lib/mite/time_entry/bookmark.rb', line 18

def follow
  Mite::TimeEntry.all(:params => params)
end

#paramsObject



10
11
12
13
14
15
16
# File 'lib/mite/time_entry/bookmark.rb', line 10

def params
  hash = CGI.parse(query)
  hash.each do |k, v|
    hash[k] = v[0]
  end
  hash
end

#team?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/mite/time_entry/bookmark.rb', line 6

def team?
  user_id.blank?
end