Class: PhrasingBackgroundImageWidget
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- PhrasingBackgroundImageWidget
- Defined in:
- app/widgets/phrasing_background_image_widget.rb
Constant Summary collapse
- HTML_CLASS =
'phrasable-background-image'
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#wrapped_html ⇒ Object
Returns the value of attribute wrapped_html.
Instance Method Summary collapse
-
#initialize(phrasing_image, view_context, wrapped_html, options = {}) ⇒ PhrasingBackgroundImageWidget
constructor
A new instance of PhrasingBackgroundImageWidget.
- #tag ⇒ Object
Constructor Details
#initialize(phrasing_image, view_context, wrapped_html, options = {}) ⇒ PhrasingBackgroundImageWidget
Returns a new instance of PhrasingBackgroundImageWidget.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/widgets/phrasing_background_image_widget.rb', line 9 def initialize(phrasing_image, view_context, wrapped_html, = {}) super(phrasing_image) @view_context = view_context @wrapped_html = wrapped_html = [:style] = "background-image: url(#{image_url})" @tag = .delete(:tag) return unless view_context.can_edit_phrases? add_phrasable_image_class end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'app/widgets/phrasing_background_image_widget.rb', line 7 def end |
#wrapped_html ⇒ Object
Returns the value of attribute wrapped_html.
7 8 9 |
# File 'app/widgets/phrasing_background_image_widget.rb', line 7 def wrapped_html @wrapped_html end |
Instance Method Details
#tag ⇒ Object
22 23 24 |
# File 'app/widgets/phrasing_background_image_widget.rb', line 22 def tag @tag || :div end |