Class: Bookit::Content::Image

Inherits:
Generic
  • Object
show all
Defined in:
lib/bookit/content/image.rb

Instance Attribute Summary collapse

Attributes inherited from Generic

#attributes

Instance Method Summary collapse

Methods inherited from Generic

#is_type?, #type

Constructor Details

#initialize(source, options = {}) ⇒ Image

takes a source url



9
10
11
12
13
# File 'lib/bookit/content/image.rb', line 9

def initialize(source, options={})
  @source = source

  super options
end

Instance Attribute Details

#sourceObject

Returns the value of attribute source.



6
7
8
# File 'lib/bookit/content/image.rb', line 6

def source
  @source
end

Instance Method Details

#renderObject

returns the url to the image



16
17
18
# File 'lib/bookit/content/image.rb', line 16

def render
  [open(source), attributes]
end