Class: ProoflinkConnect::ShareButton
- Inherits:
-
Object
- Object
- ProoflinkConnect::ShareButton
- Defined in:
- lib/prooflink_connect/share_button.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(message = nil, options = {}) ⇒ ShareButton
constructor
A new instance of ShareButton.
- #to_html ⇒ Object
Constructor Details
#initialize(message = nil, options = {}) ⇒ ShareButton
Returns a new instance of ShareButton.
6 7 8 9 |
# File 'lib/prooflink_connect/share_button.rb', line 6 def initialize( = nil, = {}) @message = @options = end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/prooflink_connect/share_button.rb', line 3 def @message end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/prooflink_connect/share_button.rb', line 4 def @options end |
Instance Method Details
#to_html ⇒ Object
11 12 13 14 |
# File 'lib/prooflink_connect/share_button.rb', line 11 def to_html html = "<iframe src='#{ProoflinkConnect.config.protocol}://#{[ProoflinkConnect.config.subdomain, ProoflinkConnect.config.provider_endpoint].compact.join(".")}/#{@options[:locale]||"en"}/shares/button?message=#{CGI.escape @message}' style='width: 112px; height: 16px; border: 0;display: block' frameborder='0' scrolling='no'></iframe>" html.respond_to?(:html_safe) ? html.html_safe : html end |