Class: SexItUp::SexItUpImage

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/sex_it_up.rb

Constant Summary collapse

RESULT_LIMIT =
10

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sizesObject (readonly)

Returns the value of attribute sizes.



22
23
24
# File 'lib/sex_it_up.rb', line 22

def sizes
  @sizes
end

Class Method Details

.find_all(term) ⇒ Object

Want to give each user a unique avatar? Assign their profile image to the image returned here.



26
27
28
29
30
# File 'lib/sex_it_up.rb', line 26

def self.find_all(term)
  query = "site:commons.wikimedia.org \"is in the public domain\" #{term}"
  cache_search(query, term)
  images_for(term)
end

Instance Method Details

#attachment_sizesObject



36
37
38
# File 'lib/sex_it_up.rb', line 36

def attachment_sizes
  @sizes||={:thumb => ["100x100"]}
end

#set_attachment_sizes(sizes = {:thumb => ["100x100"]}) ⇒ Object



32
33
34
# File 'lib/sex_it_up.rb', line 32

def set_attachment_sizes(sizes = {:thumb => ["100x100"]})
  @sizes = sizes
end