Class: FacebookSocialPlugins::Plugin::Social
- Defined in:
- lib/facebook-social_plugins/plugin/social.rb
Direct Known Subclasses
ActivityFeed, AddToTimeline, Button, Comments, Facepile, LikeBox, LiveStream, LoginButton, RecommendationsBox, Registration
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes inherited from UiHelper
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Social
constructor
A new instance of Social.
- #render ⇒ Object
-
#validate! ⇒ Object
the :special type indicates call to special type validator.
Constructor Details
#initialize(options = {}) ⇒ Social
Returns a new instance of Social.
6 7 8 9 |
# File 'lib/facebook-social_plugins/plugin/social.rb', line 6 def initialize = {} @options = validate! end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/facebook-social_plugins/plugin/social.rb', line 4 def @options end |
Instance Method Details
#render ⇒ Object
11 12 13 |
# File 'lib/facebook-social_plugins/plugin/social.rb', line 11 def render content_tag :div, '', .merge(:class => plugin_class) end |
#validate! ⇒ Object
the :special type indicates call to special type validator
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/facebook-social_plugins/plugin/social.rb', line 16 def validate! return if .empty? = {} .each do |key, value| attr_key = find_att_key(key) raise ArgumentError, "Unknown or unsupported attribute #{key}" unless attr_key attributes[attr_key] == :special ? send("validate_#{key.to_s.underscore}", value) : valid?(value, attributes[attr_key]) [attr_key] = value end @options = end |