Class: SeoSensei::Resource
- Inherits:
-
Object
- Object
- SeoSensei::Resource
- Defined in:
- lib/seo_sensei/resource.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(translation, obj, url) ⇒ Resource
constructor
A new instance of Resource.
- #keywords ⇒ Object
- #seo_image_height ⇒ Object
- #seo_image_url ⇒ Object
- #seo_image_width ⇒ Object
- #title ⇒ Object
- #url ⇒ Object
- #use_image? ⇒ Boolean
Constructor Details
#initialize(translation, obj, url) ⇒ Resource
Returns a new instance of Resource.
3 4 5 6 7 |
# File 'lib/seo_sensei/resource.rb', line 3 def initialize(translation, obj, url) @translation = translation @obj = obj @url = url end |
Instance Method Details
#description ⇒ Object
17 18 19 |
# File 'lib/seo_sensei/resource.rb', line 17 def description @translation[:description] end |
#keywords ⇒ Object
21 22 23 |
# File 'lib/seo_sensei/resource.rb', line 21 def keywords @translation[:keywords] end |
#seo_image_height ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/seo_sensei/resource.rb', line 45 def seo_image_height if use_obj_image? @obj.seo_image_dimensions[:height].to_s elsif use_translation_image? @translation[:seo_image_height] end end |
#seo_image_url ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/seo_sensei/resource.rb', line 29 def seo_image_url if use_obj_image? @obj.seo_image_url elsif use_translation_image? @translation[:seo_image_url] end end |
#seo_image_width ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/seo_sensei/resource.rb', line 37 def seo_image_width if use_obj_image? @obj.seo_image_dimensions[:width].to_s elsif use_translation_image? @translation[:seo_image_width] end end |
#title ⇒ Object
13 14 15 |
# File 'lib/seo_sensei/resource.rb', line 13 def title @translation[:title] end |
#url ⇒ Object
9 10 11 |
# File 'lib/seo_sensei/resource.rb', line 9 def url @url end |
#use_image? ⇒ Boolean
25 26 27 |
# File 'lib/seo_sensei/resource.rb', line 25 def use_image? use_obj_image? || use_translation_image? end |