Module: Ubiquitously::Postable::Post::InstanceMethods

Defined in:
lib/ubiquitously/models/service/post/postable.rb

Instance Method Summary collapse

Instance Method Details

#private?Boolean

Returns:

  • (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

Returns:

  • (Boolean)


59
60
61
# File 'lib/ubiquitously/models/service/post/postable.rb', line 59

def public?
  privacy == 0 || privacy == "0" || privacy == "public"
end

#submit_urlObject



67
68
69
# File 'lib/ubiquitously/models/service/post/postable.rb', line 67

def submit_url
  self.class.submit_url(self)
end

#tokenizeObject



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.tags.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