Class: JustShare::SocialLinker
- Inherits:
-
Object
- Object
- JustShare::SocialLinker
- Defined in:
- lib/just_share/social_linker.rb
Overview
ParentClass which have the attrs to create the links
Direct Known Subclasses
Blogger, Delicious, Facebook, GooglePlus, LinkedIn, Pinterest, Reddit, Tumblr, Twitter, Vk, Xing
Instance Attribute Summary collapse
-
#aux_link ⇒ Object
The redirect link on the post.
-
#domain ⇒ Object
Attrs filled on children.
-
#hash_tags ⇒ Object
Array of HashTags, like nature, sunset, HereWeGo…
-
#image_url ⇒ Object
URL to the image.
-
#message ⇒ Object
Base Message (like from the Ad.social_message).
-
#params ⇒ Object
ex: facebook.com twitter.com …
-
#path ⇒ Object
ex: facebook.com twitter.com …
-
#title ⇒ Object
Attrs accessor for it classes.
-
#via ⇒ Object
The app which post like: PageRenter.
Instance Method Summary collapse
-
#get_post_link ⇒ Object
FacadeMethod.
-
#initialize(params = {}) ⇒ SocialLinker
constructor
It constructor must be reused by it children.
-
#link ⇒ Object
Overwriting the link getter to return it encoded as HTTP uses.
-
#setup_attrs ⇒ Object
Method to be implemented on it children!.
Constructor Details
#initialize(params = {}) ⇒ SocialLinker
It constructor must be reused by it children
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/just_share/social_linker.rb', line 19 def initialize(params={}) # SetUp the attrs self.via=params[:via] || self.via=JustShare.via self.aux_link=params[:link] || self.aux_link=JustShare.link self.title=params[:title] || self.=JustShare.title self.=params[:message] || self.=JustShare. self.=params[:hash_tags] || self.=JustShare. self.image_url=params[:image_url] || self.=JustShare.image_url self. = JustShare. if self..nil? || params[:hash_tags].nil? end |
Instance Attribute Details
#aux_link ⇒ Object
The redirect link on the post
8 9 10 |
# File 'lib/just_share/social_linker.rb', line 8 def aux_link @aux_link end |
#domain ⇒ Object
Attrs filled on children
14 15 16 |
# File 'lib/just_share/social_linker.rb', line 14 def domain @domain end |
#hash_tags ⇒ Object
Array of HashTags, like nature, sunset, HereWeGo…
10 11 12 |
# File 'lib/just_share/social_linker.rb', line 10 def @hash_tags end |
#image_url ⇒ Object
URL to the image
11 12 13 |
# File 'lib/just_share/social_linker.rb', line 11 def image_url @image_url end |
#message ⇒ Object
Base Message (like from the Ad.social_message)
7 8 9 |
# File 'lib/just_share/social_linker.rb', line 7 def @message end |
#params ⇒ Object
ex: facebook.com twitter.com …
16 17 18 |
# File 'lib/just_share/social_linker.rb', line 16 def params @params end |
#path ⇒ Object
ex: facebook.com twitter.com …
15 16 17 |
# File 'lib/just_share/social_linker.rb', line 15 def path @path end |
#title ⇒ Object
Attrs accessor for it classes
6 7 8 |
# File 'lib/just_share/social_linker.rb', line 6 def title @title end |
#via ⇒ Object
The app which post like: PageRenter
9 10 11 |
# File 'lib/just_share/social_linker.rb', line 9 def via @via end |
Instance Method Details
#get_post_link ⇒ Object
FacadeMethod
31 32 33 34 35 36 |
# File 'lib/just_share/social_linker.rb', line 31 def get_post_link # SetUp attrs setup_attrs # Create & return it URL created "#{self.domain}/#{self.path}?#{params}" end |
#link ⇒ Object
Overwriting the link getter to return it encoded as HTTP uses
39 40 41 |
# File 'lib/just_share/social_linker.rb', line 39 def link CGI::escape(self.aux_link) unless self.aux_link.nil? end |
#setup_attrs ⇒ Object
Method to be implemented on it children!
44 45 |
# File 'lib/just_share/social_linker.rb', line 44 def setup_attrs end |