Class: WeThePeople::Resources::Petition
Constant Summary
WeThePeople::Resource::COERCERS
Instance Method Summary
collapse
add_attribute_key, all, attribute, bare_name, belongs_to, build_index_url, build_resource_url, coerce_value, cursor, fetch, find, has_embedded, has_many, has_many_embedded, #initialize, path, #path, #to_json
Instance Method Details
#expired? ⇒ Boolean
37
38
39
|
# File 'lib/we_the_people/resources/petition.rb', line 37
def expired?
deadline < Time.now
end
|
#failed? ⇒ Boolean
25
26
27
|
# File 'lib/we_the_people/resources/petition.rb', line 25
def failed?
expired? && !successful?
end
|
#response? ⇒ Boolean
33
34
35
|
# File 'lib/we_the_people/resources/petition.rb', line 33
def response?
!response.nil?
end
|
#signatures_needed? ⇒ Boolean
29
30
31
|
# File 'lib/we_the_people/resources/petition.rb', line 29
def signatures_needed?
signatures_needed > 0
end
|
#successful? ⇒ Boolean
21
22
23
|
# File 'lib/we_the_people/resources/petition.rb', line 21
def successful?
signatures_needed == 0
end
|