Class: Afterburn::List
Defined Under Namespace
Modules: History, Role
Classes: UnknownRole
Instance Attribute Summary
#id
Class Method Summary
collapse
Instance Method Summary
collapse
#fetch, fetch, find, inherited, #initialize, initialize_from_trello_object, #load, #redis_key, #trello_object, #trello_object=, wrap, wrapper_class, wrapper_name, #wrapper_name
Methods included from Helpers
#constantize, #redis, #titleize
Class Method Details
.factory(trello_list) ⇒ Object
34
35
36
37
38
|
# File 'lib/afterburn/list.rb', line 34
def self.factory(trello_list)
initialize_from_trello_object(trello_list).tap do |list|
list.extend(History) if Role.historical?(list.role)
end
end
|
.historical(list) ⇒ Object
40
41
42
|
# File 'lib/afterburn/list.rb', line 40
def self.historical(list)
HistoricalList.initialize_from_trello_object(list.trello_list)
end
|
.roles ⇒ Object
30
31
32
|
# File 'lib/afterburn/list.rb', line 30
def self.roles
Role::VALID_ROLES
end
|
Instance Method Details
#card_count ⇒ Object
61
62
63
|
# File 'lib/afterburn/list.rb', line 61
def card_count
trello_cards.count
end
|
#name ⇒ Object
44
45
46
|
# File 'lib/afterburn/list.rb', line 44
def name
trello_list.name
end
|
#role ⇒ Object
53
54
55
|
# File 'lib/afterburn/list.rb', line 53
def role
role_store.value
end
|
#role=(role) ⇒ Object
48
49
50
51
|
# File 'lib/afterburn/list.rb', line 48
def role=(role)
raise UnknownRole.new("Tried to set unrecognized '#{role}'") unless Role.valid?(role)
role_store.value = role
end
|
#timestamp_count_vector(timestamps) ⇒ Object
#trello_cards ⇒ Object
57
58
59
|
# File 'lib/afterburn/list.rb', line 57
def trello_cards
trello_list.cards
end
|
#update_attributes(attributes) ⇒ Object
69
70
71
72
73
|
# File 'lib/afterburn/list.rb', line 69
def update_attributes(attributes)
attributes.each do |key, value|
send("#{key}=", value)
end
end
|