Class: 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.
20 21 22 23 24 25 26 |
# File 'lib/tdiary/base.rb', line 20 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.
17 18 19 |
# File 'lib/tdiary/base.rb', line 17 def cgi @cgi end |
#conf ⇒ Object (readonly)
Returns the value of attribute conf.
17 18 19 |
# File 'lib/tdiary/base.rb', line 17 def conf @conf end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
16 17 18 |
# File 'lib/tdiary/base.rb', line 16 def @cookies end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
16 17 18 |
# File 'lib/tdiary/base.rb', line 16 def date @date end |
#diaries ⇒ Object (readonly)
Returns the value of attribute diaries.
16 17 18 |
# File 'lib/tdiary/base.rb', line 16 def diaries @diaries end |
#ignore_parser_cache ⇒ Object (readonly)
Returns the value of attribute ignore_parser_cache.
18 19 20 |
# File 'lib/tdiary/base.rb', line 18 def ignore_parser_cache @ignore_parser_cache end |
#rhtml ⇒ Object (readonly)
Returns the value of attribute rhtml.
17 18 19 |
# File 'lib/tdiary/base.rb', line 17 def rhtml @rhtml end |
Instance Method Details
#[](date) ⇒ Object
46 47 48 |
# File 'lib/tdiary/base.rb', line 46 def []( date ) @diaries[date.strftime( '%Y%m%d' )] end |
#calendar ⇒ Object
50 51 52 |
# File 'lib/tdiary/base.rb', line 50 def calendar @years = @io.calendar unless @years end |
#eval_rhtml(prefix = '') ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/tdiary/base.rb', line 28 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").untaint r = ERB.new(body).result(binding) end end r end |
#last_modified ⇒ Object
42 43 44 |
# File 'lib/tdiary/base.rb', line 42 def last_modified nil end |