Module: Ubiquitously::Postable::Post::InstanceMethods
- Defined in:
- lib/ubiquitously/models/service/post/postable.rb
Instance Method Summary collapse
- #private? ⇒ Boolean
- #public? ⇒ Boolean
- #submit_url ⇒ Object
- #tokenize ⇒ Object
- #url_permutations(url) ⇒ Object
Instance Method Details
#private? ⇒ Boolean
55 56 57 |
# File 'lib/ubiquitously/models/service/post/postable.rb', line 55 def private? privacy == 1 || privacy == "1" || privacy == "private" end |
#public? ⇒ Boolean
59 60 61 |
# File 'lib/ubiquitously/models/service/post/postable.rb', line 59 def public? privacy == 0 || privacy == "0" || privacy == "public" end |
#submit_url ⇒ Object
67 68 69 |
# File 'lib/ubiquitously/models/service/post/postable.rb', line 67 def submit_url self.class.submit_url(self) end |
#tokenize ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/ubiquitously/models/service/post/postable.rb', line 45 def tokenize { :url => self.url, :title => self.title, :description => self.description, :tags => self..map { |tag| tag.downcase.gsub(/[^a-z0-9\.]/, " ").squeeze(" ") }.join(", "), :categories => self.categories.map { |tag| tag.downcase.gsub(/[^a-z0-9\.]/, " ").squeeze(" ") } } end |
#url_permutations(url) ⇒ Object
63 64 65 |
# File 'lib/ubiquitously/models/service/post/postable.rb', line 63 def url_permutations(url) self.class.url_permutations(url) end |