Module: SocialButtons::Assistant::ClassMethods
- Defined in:
- lib/social_buttons/view_helpers/assistant.rb
Instance Attribute Summary collapse
-
#default_options ⇒ Object
writeonly
Sets the attribute default_options.
Instance Method Summary collapse
- #help ⇒ Object
- #myname ⇒ Object
- #options_to_data_params(opts) ⇒ Object
- #options_to_query_string(subject, opts) ⇒ Object
Instance Attribute Details
#default_options=(value) ⇒ Object (writeonly)
Sets the attribute default_options
6 7 8 |
# File 'lib/social_buttons/view_helpers/assistant.rb', line 6 def (value) @default_options = value end |
Instance Method Details
#help ⇒ Object
12 13 14 |
# File 'lib/social_buttons/view_helpers/assistant.rb', line 12 def help "Please HELP by filling in the help of the #{myname} button :) (see google+ button code)" end |
#myname ⇒ Object
8 9 10 |
# File 'lib/social_buttons/view_helpers/assistant.rb', line 8 def myname self.name.demodulize end |
#options_to_data_params(opts) ⇒ Object
16 17 18 19 20 |
# File 'lib/social_buttons/view_helpers/assistant.rb', line 16 def (opts) params = {} opts.each {|k, v| params["data-#{k}"] = v} params end |
#options_to_query_string(subject, opts) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/social_buttons/view_helpers/assistant.rb', line 22 def (subject, opts) # formulate the url, and then strip the part before first '?' query_params = opts.slice(:url, :media, :description) full_url = subject.url_for(query_params) full_url.sub(/^([^?]*)/, '') end |