Class: Yashare::Widget

Inherits:
Object
  • Object
show all
Defined in:
lib/yashare/widget.rb

Instance Method Summary collapse

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_sObject



12
13
14
# File 'lib/yashare/widget.rb', line 12

def to_s
  @html ||= render
end