Class: Boxspring::Story

Inherits:
Base
  • Object
show all
Includes:
Taggable
Defined in:
lib/boxspring/story.rb

Instance Method Summary collapse

Methods included from Taggable

#tags

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Boxspring::Base

Instance Method Details

#contentObject



40
41
42
43
44
45
46
47
48
# File 'lib/boxspring/story.rb', line 40

def content
  @_content ||= begin
    content_class = Boxspring.const_get( self.content_type ) \
      rescue nil
    content_class ? 
      content_class.new( self.attributes[ :content ] ) :
      nil    
  end
end

#showObject



50
51
52
53
54
55
56
# File 'lib/boxspring/story.rb', line 50

def show
  @_show ||= begin
    self.attributes.include?( :show ) ?
      Show.new( self.attributes[ :show ] ) :
      nil
  end
end