Class: Yashare::Widget
- Inherits:
-
Object
- Object
- Yashare::Widget
- Defined in:
- lib/yashare/widget.rb
Instance Method Summary collapse
-
#initialize(view, opts = {}) ⇒ Widget
constructor
A new instance of Widget.
- #to_s ⇒ Object
Constructor Details
#initialize(view, opts = {}) ⇒ Widget
Returns a new instance of Widget.
3 4 5 6 7 8 9 10 |
# File 'lib/yashare/widget.rb', line 3 def initialize(view, opts = {}) @view = view @services = opts.fetch(:services, %w(vkontakte facebook twitter lj)) @image = opts.fetch(:image, nil) @type = opts.fetch(:type, 'button') @lang = opts.fetch(:lang, 'ru') end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/yashare/widget.rb', line 12 def to_s @html ||= render end |