Class: BlogView

Inherits:
Object
  • Object
show all
Defined in:
app/decorators/blog_view.rb

Instance Method Summary collapse

Constructor Details

#initialize(blog) ⇒ BlogView

Returns a new instance of BlogView.


2
3
4
# File 'app/decorators/blog_view.rb', line 2

def initialize(blog)
  @blog = blog
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)


12
13
14
# File 'app/decorators/blog_view.rb', line 12

def method_missing(method, *args, &block)
  @blog.send(method, *args, &block)
end

Instance Method Details

#favicon_urlObject


6
7
8
# File 'app/decorators/blog_view.rb', line 6

def favicon_url
  "http://www.google.com/s2/favicons?domain=#{URI(posts.first.try(:source_url) || "http://#{Rails.configuration.x.domain}").host}"
end