Class: Irwi::Config
- Inherits:
-
Object
- Object
- Irwi::Config
- Defined in:
- lib/irwi/config.rb
Instance Attribute Summary collapse
- #comparator ⇒ Object
-
#controller_name ⇒ Object
Returns the value of attribute controller_name.
- #formatter ⇒ Object
-
#page_attachment_class_name ⇒ Object
Returns the value of attribute page_attachment_class_name.
-
#page_class_name ⇒ Object
Returns the value of attribute page_class_name.
-
#page_version_class_name ⇒ Object
Returns the value of attribute page_version_class_name.
-
#page_version_foreign_key ⇒ Object
Returns the value of attribute page_version_foreign_key.
- #paginator ⇒ Object
-
#user_class_name ⇒ Object
Returns the value of attribute user_class_name.
Instance Method Summary collapse
-
#add_system_page(action, path) ⇒ Object
Add system page.
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #page_attachment_class ⇒ Object
- #page_class ⇒ Object
- #page_version_class ⇒ Object
- #system_pages ⇒ Object
- #user_class ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
45 46 47 48 49 50 51 52 |
# File 'lib/irwi/config.rb', line 45 def initialize @controller_name = 'wiki_pages' @user_class_name = 'User' @page_class_name = 'WikiPage' @page_version_class_name = 'WikiPageVersion' @page_attachment_class_name = nil @page_version_foreign_key = 'page_id' end |
Instance Attribute Details
#comparator ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/irwi/config.rb', line 26 def comparator @comparator ||= begin require 'irwi/comparators/diff_lcs' self.comparator = Irwi::Comparators::DiffLcs.new end end |
#controller_name ⇒ Object
Returns the value of attribute controller_name.
5 6 7 |
# File 'lib/irwi/config.rb', line 5 def controller_name @controller_name end |
#formatter ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/irwi/config.rb', line 15 def formatter @formatter ||= begin require 'irwi/formatters/red_cloth' self.formatter = Irwi::Formatters::RedCloth.new end end |
#page_attachment_class_name ⇒ Object
Returns the value of attribute page_attachment_class_name.
9 10 11 |
# File 'lib/irwi/config.rb', line 9 def @page_attachment_class_name end |
#page_class_name ⇒ Object
Returns the value of attribute page_class_name.
7 8 9 |
# File 'lib/irwi/config.rb', line 7 def page_class_name @page_class_name end |
#page_version_class_name ⇒ Object
Returns the value of attribute page_version_class_name.
8 9 10 |
# File 'lib/irwi/config.rb', line 8 def page_version_class_name @page_version_class_name end |
#page_version_foreign_key ⇒ Object
Returns the value of attribute page_version_foreign_key.
10 11 12 |
# File 'lib/irwi/config.rb', line 10 def page_version_foreign_key @page_version_foreign_key end |
#paginator ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/irwi/config.rb', line 37 def paginator @paginator ||= begin require 'irwi/paginators/none' self.paginator = Irwi::Paginators::None.new end end |
#user_class_name ⇒ Object
Returns the value of attribute user_class_name.
6 7 8 |
# File 'lib/irwi/config.rb', line 6 def user_class_name @user_class_name end |
Instance Method Details
#add_system_page(action, path) ⇒ Object
Add system page
79 80 81 |
# File 'lib/irwi/config.rb', line 79 def add_system_page( action, path ) system_pages[ action.to_s ] = path.to_s end |
#page_attachment_class ⇒ Object
62 63 64 |
# File 'lib/irwi/config.rb', line 62 def .constantize end |
#page_class ⇒ Object
54 55 56 |
# File 'lib/irwi/config.rb', line 54 def page_class page_class_name.constantize end |
#page_version_class ⇒ Object
58 59 60 |
# File 'lib/irwi/config.rb', line 58 def page_version_class page_version_class_name.constantize end |
#system_pages ⇒ Object
70 71 72 73 74 |
# File 'lib/irwi/config.rb', line 70 def system_pages @system_pages ||= { 'all' => 'all' } end |
#user_class ⇒ Object
66 67 68 |
# File 'lib/irwi/config.rb', line 66 def user_class user_class_name.constantize end |