Class: BaseJSON

Inherits:
Object
  • Object
show all
Defined in:
lib/veye/views/base_json.rb

Instance Method Summary collapse

Constructor Details

#initializeBaseJSON

Returns a new instance of BaseJSON.



3
4
5
# File 'lib/veye/views/base_json.rb', line 3

def initialize
  @results = {}
end

Instance Method Details

#after(paging = nil, allow_pagination = false) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/veye/views/base_json.rb', line 9

def after(paging = nil, allow_pagination = false)
  if allow_pagination && !paging.nil?
    @results[:paging] = paging
  end

  puts @results.to_json
end

#beforeObject



7
# File 'lib/veye/views/base_json.rb', line 7

def before; end

#format(results) ⇒ Object

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/veye/views/base_json.rb', line 17

def format(results)
  raise NotImplementedError
end