Class: View::Configuration
- Inherits:
-
Object
- Object
- View::Configuration
- Defined in:
- lib/view/configuration.rb
Overview
The central place for all configuration.
Instance Attribute Summary (collapse)
-
- (Object) default_formatter
Which formatter will be used by default.
-
- (Object) default_list_formatter
The auto formatter will choose this formatter by default when your value is an array (or really, something that responds to each).
-
- (Object) file_methods
To determine if something is an uploaded image, it checks to see whether it responds to one of these methods.
-
- (Object) guessing_methods
Used by the guess filter, these are the methods used to format an object.
-
- (Object) path_arguments
You can set a default argument for rendering images, like the style or size of the image.
-
- (Object) path_methods
To show an image, it will use one of these methods to get the src attribute.
Instance Method Summary (collapse)
-
- (Object) configure {|config| ... }
Shorthand for configuring this gem.
-
- (Configuration) initialize
constructor
A new instance of Configuration.
Constructor Details
- (Configuration) initialize
A new instance of Configuration
43 44 45 46 47 48 49 50 51 |
# File 'lib/view/configuration.rb', line 43 def initialize self.guessing_methods = %w|to_label display_name full_name name title username login value to_s| self.file_methods = %w|file? mounted_as public_filename| self.path_methods = %w|url mounted_as public_filename| self.path_arguments = [] self.default_formatter = :auto self.default_list_formatter = :sentence end |
Instance Attribute Details
- (Object) default_formatter
Which formatter will be used by default. The default is auto, which does all sorts of interesting stuff to see what to do.
24 25 26 |
# File 'lib/view/configuration.rb', line 24 def default_formatter @default_formatter end |
- (Object) default_list_formatter
The auto formatter will choose this formatter by default when your value is an array (or really, something that responds to each).
28 29 30 |
# File 'lib/view/configuration.rb', line 28 def default_list_formatter @default_list_formatter end |
- (Object) file_methods
To determine if something is an uploaded image, it checks to see whether it responds to one of these methods.
12 13 14 |
# File 'lib/view/configuration.rb', line 12 def file_methods @file_methods end |
- (Object) guessing_methods
Used by the guess filter, these are the methods used to format an object. It will use the first method that the object responds to.
8 9 10 |
# File 'lib/view/configuration.rb', line 8 def guessing_methods @guessing_methods end |
- (Object) path_arguments
You can set a default argument for rendering images, like the style or size of the image. It will be passed to one of the path_methods.
20 21 22 |
# File 'lib/view/configuration.rb', line 20 def path_arguments @path_arguments end |
- (Object) path_methods
To show an image, it will use one of these methods to get the src attribute.
16 17 18 |
# File 'lib/view/configuration.rb', line 16 def path_methods @path_methods end |
Instance Method Details
- (Object) configure {|config| ... }
Shorthand for configuring this gem.
39 40 41 |
# File 'lib/view/configuration.rb', line 39 def configure yield self end |