Class: Shortcodes::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/shortcodes/handler.rb

Overview

Abstract Handler

Direct Known Subclasses

Wufoo, Youtube

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(shortcode) ⇒ Handler

Returns a new instance of Handler.



10
11
12
# File 'lib/shortcodes/handler.rb', line 10

def initialize(shortcode)
  @shortcode = shortcode
end

Instance Attribute Details

#shortcodeObject (readonly)

Returns the value of attribute shortcode.



9
10
11
# File 'lib/shortcodes/handler.rb', line 9

def shortcode
  @shortcode
end

Class Method Details

.call(shortcode) ⇒ Object



5
6
7
# File 'lib/shortcodes/handler.rb', line 5

def self.call(shortcode)
  new(shortcode).render
end

Instance Method Details

#attributesObject



14
15
16
# File 'lib/shortcodes/handler.rb', line 14

def attributes
  shortcode.attributes
end

#renderObject

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/shortcodes/handler.rb', line 18

def render
  raise NotImplementedError
end