Class: CachedPage
- Inherits:
-
Object
- Object
- CachedPage
- Defined in:
- lib/ribit/action.rb
Instance Attribute Summary collapse
-
#contentType ⇒ Object
readonly
Returns the value of attribute contentType.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data, contentType) ⇒ CachedPage
constructor
A new instance of CachedPage.
- #is_time_same_or_after(lastModifiedHttpDate) ⇒ Object
- #lastModfiedHttpdate ⇒ Object
Constructor Details
#initialize(data, contentType) ⇒ CachedPage
Returns a new instance of CachedPage.
507 508 509 510 511 |
# File 'lib/ribit/action.rb', line 507 def initialize( data, contentType ) @data = data @contentType = contentType @lastModified = Time.now end |
Instance Attribute Details
#contentType ⇒ Object (readonly)
Returns the value of attribute contentType.
504 505 506 |
# File 'lib/ribit/action.rb', line 504 def contentType @contentType end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
504 505 506 |
# File 'lib/ribit/action.rb', line 504 def data @data end |
Instance Method Details
#is_time_same_or_after(lastModifiedHttpDate) ⇒ Object
514 515 516 517 518 519 520 521 522 523 524 525 |
# File 'lib/ribit/action.rb', line 514 def is_time_same_or_after( lastModifiedHttpDate ) time = Time.httpdate( lastModifiedHttpDate ) # NOTE: @lastModified time contains also fraction of seconds but httpdate # doesn't have them => we have to compare full seconds if ( ( time.to_i <=> @lastModified.to_i ) >= 0 ) return true end return false end |
#lastModfiedHttpdate ⇒ Object
528 529 530 |
# File 'lib/ribit/action.rb', line 528 def lastModfiedHttpdate @lastModified.httpdate end |