Class: Devbootcamp::Cohort
- Inherits:
-
Model
- Object
- Model
- Devbootcamp::Cohort
show all
- Defined in:
- lib/devbootcamp/cohort.rb
Instance Attribute Summary
Attributes inherited from Model
#attributes
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Model
#as_json, attributes, #initialize, #serializable_hash
Class Method Details
.all ⇒ Object
5
6
7
|
# File 'lib/devbootcamp/cohort.rb', line 5
def self.all
Devbootcamp::Auth.get("/cohorts", cache_for: 1.week).map(&method(:new))
end
|
.names ⇒ Object
9
10
11
|
# File 'lib/devbootcamp/cohort.rb', line 9
def self.names
all.map(&:name)
end
|
Instance Method Details
#chi? ⇒ Boolean
17
18
19
|
# File 'lib/devbootcamp/cohort.rb', line 17
def chi?
location == "Chicago"
end
|
#sf? ⇒ Boolean
13
14
15
|
# File 'lib/devbootcamp/cohort.rb', line 13
def sf?
location == "San Francisco"
end
|
#users ⇒ Object
21
22
23
|
# File 'lib/devbootcamp/cohort.rb', line 21
def users
@users ||=Devbootcamp::Auth.get("/cohorts/#{id}/users", cache_for: 1.day).map(&Devbootcamp::User.method(:new))
end
|