Module: SocialButtons::GooglePlus
- Extended by:
- Help
- Includes:
- Assistant
- Defined in:
- lib/social_buttons/view_helpers/google_plus.rb,
lib/social_buttons/view_helpers/google_plus/help.rb
Defined Under Namespace
Modules: Help Classes: AsyncScripter, Scripter
Constant Summary collapse
- CLASS =
"g-plusone"
Class Method Summary collapse
Instance Method Summary collapse
-
#google_plus_button(*args) ⇒ Object
To NOT output script = google_button :locale => ‘es’, script: false.
Methods included from Help
Class Method Details
.default_options ⇒ Object
39 40 41 42 43 |
# File 'lib/social_buttons/view_helpers/google_plus.rb', line 39 def @default_options ||= { annotations: "inline" } end |
Instance Method Details
#google_plus_button(*args) ⇒ Object
To NOT output script
= google_button :locale => 'es', script: false
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/social_buttons/view_helpers/google_plus.rb', line 17 def *args = args. clazz = SocialButtons::GooglePlus return clazz.script() if args.first == :script use_script = .delete :script locale = .delete(:locale) || .delete(:lang) params = clazz.(clazz..merge()) params.merge!(class: CLASS) scripter_class = use_script == :async ? clazz::AsyncScripter : clazz::Scripter html = "".html_safe html << content_tag(:div, nil, params) html << scripter_class.new(self).script(locale) if use_script html end |