Class: JustShare::Twitter

Inherits:
SocialLinker show all
Defined in:
lib/just_share/twitter.rb

Instance Attribute Summary

Attributes inherited from SocialLinker

#aux_link, #domain, #hash_tags, #image_url, #message, #params, #path, #title, #via

Instance Method Summary collapse

Methods inherited from SocialLinker

#get_post_link, #initialize, #link

Constructor Details

This class inherits a constructor from JustShare::SocialLinker

Instance Method Details

#setup_attrsObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/just_share/twitter.rb', line 2

def setup_attrs
  # Base URL
  self.domain='https://twitter.com'
  self.path='intent/tweet'

  # Params (for twitter it is possible set more params on URL, but to more style check it tags documentation)
  via_param = "via=#{self.via}" # IMPORTANT: be the App? Like PageRenter?
  url_param = "url=#{self.link}"
  text_param = "text=#{self.message}"
  hash_tag_param = "hashtags=#{JustShare.array_to_str_params self.hash_tags}"

  # build the params
  self.params = "#{text_param}&#{url_param}&#{via_param}&#{hash_tag_param}"
end