Class: TheGrid::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/the_grid/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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_scopesObject

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_pageObject

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_jsonObject

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

#applyObject



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