Class: Hobix::FlickrPlugin

Inherits:
BasePlugin show all
Defined in:
lib/hobix/plugin/flickr.rb

Overview

we just keep parameters from hobix.yaml here

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BasePlugin

inherited, start

Constructor Details

#initialize(weblog, params = {}) ⇒ FlickrPlugin

Returns a new instance of FlickrPlugin.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/hobix/plugin/flickr.rb', line 43

def initialize(weblog, params = {})
  raise %{the flickr plugin needs a "userid" parameter. see hobix/plugin/flickr.rb for details} unless params.member? "userid"
  @@userid = params["userid"]
  @@num = params["num"] || 5
  @@size =
    case params["size"]
    when nil, "small"
      "s"
    when "thumbnail"
      "t"
    when "midsize"
      "m"
    else
      raise %{unknown size value "#{params["size"]}" for flickr plugin. use "small", "thumbnail" or "midsize"}
    end
  @@title = params["title"] || "Recent Pictures"
  @@in_sidebarBox_div = lambda { |x| (x.nil? ? true : x) }[params["in-sidebarBox-div"]]
end

Class Method Details

.in_sidebarBox_div?Boolean

Returns:

  • (Boolean)


66
# File 'lib/hobix/plugin/flickr.rb', line 66

def self.in_sidebarBox_div?; @@in_sidebarBox_div; end

.numObject



63
# File 'lib/hobix/plugin/flickr.rb', line 63

def self.num; @@num; end

.sizeObject



64
# File 'lib/hobix/plugin/flickr.rb', line 64

def self.size; @@size; end

.titleObject



65
# File 'lib/hobix/plugin/flickr.rb', line 65

def self.title; @@title; end

.useridObject



62
# File 'lib/hobix/plugin/flickr.rb', line 62

def self.userid; @@userid; end