Class: TheGrid::Config
- Inherits:
-
Object
- Object
- TheGrid::Config
- Defined in:
- lib/the_grid/config.rb
Instance Attribute Summary collapse
-
#commands_lookup_scopes ⇒ Object
Returns the value of attribute commands_lookup_scopes.
-
#default_max_per_page ⇒ Object
Returns the value of attribute default_max_per_page.
-
#prettify_json ⇒ Object
Returns the value of attribute prettify_json.
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
5 6 7 8 |
# File 'lib/the_grid/config.rb', line 5 def initialize self.commands_lookup_scopes = [] self.prettify_json = false end |
Instance Attribute Details
#commands_lookup_scopes ⇒ Object
Returns the value of attribute commands_lookup_scopes.
3 4 5 |
# File 'lib/the_grid/config.rb', line 3 def commands_lookup_scopes @commands_lookup_scopes end |
#default_max_per_page ⇒ Object
Returns the value of attribute default_max_per_page.
3 4 5 |
# File 'lib/the_grid/config.rb', line 3 def default_max_per_page @default_max_per_page end |
#prettify_json ⇒ Object
Returns the value of attribute prettify_json.
3 4 5 |
# File 'lib/the_grid/config.rb', line 3 def prettify_json @prettify_json end |
Instance Method Details
#apply ⇒ Object
10 11 12 13 14 |
# File 'lib/the_grid/config.rb', line 10 def apply self.commands_lookup_scopes.flatten.each{ |s| Api::Command.register_lookup_scope(s) } Api::Command.find(:paginate).default_per_page = self.default_max_per_page Builder::Json.prettify_json = self.prettify_json end |