Class: Mack::Caching::PageCaching::Page
- Defined in:
- lib/mack-caching/page_caching/page_caching.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
Instance Method Summary collapse
-
#initialize(body, content_type = "text/html") ⇒ Page
constructor
A new instance of Page.
- #to_s ⇒ Object
Constructor Details
#initialize(body, content_type = "text/html") ⇒ Page
Returns a new instance of Page.
38 39 40 41 42 43 44 45 46 |
# File 'lib/mack-caching/page_caching/page_caching.rb', line 38 def initialize(body, content_type = "text/html") if body.is_a?(Array) raise Mack::Errors::UncacheableError.new("Multipart pages can not be cached!") if body.size > 1 @body = body.first else @body = body end @content_type = content_type end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
35 36 37 |
# File 'lib/mack-caching/page_caching/page_caching.rb', line 35 def body @body end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
36 37 38 |
# File 'lib/mack-caching/page_caching/page_caching.rb', line 36 def content_type @content_type end |
Instance Method Details
#to_s ⇒ Object
48 49 50 |
# File 'lib/mack-caching/page_caching/page_caching.rb', line 48 def to_s @body end |