Class: TDiary::TDiaryBase
- Inherits:
-
Object
- Object
- TDiary::TDiaryBase
- Includes:
- ERB::Util, ViewHelper
- Defined in:
- lib/tdiary/base.rb
Overview
class TDiaryBase
tDiary CGI
Direct Known Subclasses
TDiaryAuthorOnlyBase, TDiaryCategoryView, TDiaryPluginView, TDiarySearch, TDiaryView
Constant Summary collapse
- DIRTY_NONE =
0
- DIRTY_DIARY =
1
- DIRTY_COMMENT =
2
- DIRTY_REFERER =
4
Instance Attribute Summary collapse
-
#cgi ⇒ Object
readonly
Returns the value of attribute cgi.
-
#conf ⇒ Object
readonly
Returns the value of attribute conf.
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#diaries ⇒ Object
readonly
Returns the value of attribute diaries.
-
#ignore_parser_cache ⇒ Object
readonly
Returns the value of attribute ignore_parser_cache.
-
#rhtml ⇒ Object
readonly
Returns the value of attribute rhtml.
Instance Method Summary collapse
- #[](date) ⇒ Object
- #calendar ⇒ Object
- #eval_rhtml(prefix = '') ⇒ Object
-
#initialize(cgi, rhtml, conf) ⇒ TDiaryBase
constructor
A new instance of TDiaryBase.
- #last_modified ⇒ Object
Methods included from ViewHelper
Constructor Details
#initialize(cgi, rhtml, conf) ⇒ TDiaryBase
Returns a new instance of TDiaryBase.
19 20 21 22 23 24 25 |
# File 'lib/tdiary/base.rb', line 19 def initialize( cgi, rhtml, conf ) @cgi, @rhtml, @conf = cgi, rhtml, conf @diaries = {} @cookies = [] @io = @conf.io_class.new( self ) @ignore_parser_cache = false end |
Instance Attribute Details
#cgi ⇒ Object (readonly)
Returns the value of attribute cgi.
16 17 18 |
# File 'lib/tdiary/base.rb', line 16 def cgi @cgi end |
#conf ⇒ Object (readonly)
Returns the value of attribute conf.
16 17 18 |
# File 'lib/tdiary/base.rb', line 16 def conf @conf end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
15 16 17 |
# File 'lib/tdiary/base.rb', line 15 def @cookies end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
15 16 17 |
# File 'lib/tdiary/base.rb', line 15 def date @date end |
#diaries ⇒ Object (readonly)
Returns the value of attribute diaries.
15 16 17 |
# File 'lib/tdiary/base.rb', line 15 def diaries @diaries end |
#ignore_parser_cache ⇒ Object (readonly)
Returns the value of attribute ignore_parser_cache.
17 18 19 |
# File 'lib/tdiary/base.rb', line 17 def ignore_parser_cache @ignore_parser_cache end |
#rhtml ⇒ Object (readonly)
Returns the value of attribute rhtml.
16 17 18 |
# File 'lib/tdiary/base.rb', line 16 def rhtml @rhtml end |
Instance Method Details
#[](date) ⇒ Object
45 46 47 |
# File 'lib/tdiary/base.rb', line 45 def []( date ) @diaries[date.strftime( '%Y%m%d' )] end |
#calendar ⇒ Object
49 50 51 |
# File 'lib/tdiary/base.rb', line 49 def calendar @years = @io.calendar unless @years end |
#eval_rhtml(prefix = '') ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/tdiary/base.rb', line 27 def eval_rhtml( prefix = '' ) begin r = do_eval_rhtml( prefix ) rescue PluginError, SyntaxError, ArgumentError, Exception => e if e.class == ForceRedirect raise else body = File.read("#{File.dirname(__FILE__)}/../../views/plugin_error.rhtml") r = ERB.new(body).result(binding) end end r end |
#last_modified ⇒ Object
41 42 43 |
# File 'lib/tdiary/base.rb', line 41 def last_modified nil end |