Class: StartupStats::ApiResult

Inherits:
Object
  • Object
show all
Defined in:
lib/startupstats/response/api_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ ApiResult

include Enumerable



8
9
10
11
12
13
14
15
# File 'lib/startupstats/response/api_result.rb', line 8

def initialize args = {}
	@counts = []
	@filings = []
	@errors = []
	args.each do |k, v|  
		instance_variable_set("@#{k}",v) unless v.nil?
	end
end

Instance Attribute Details

#countsObject

Returns the value of attribute counts.



4
5
6
# File 'lib/startupstats/response/api_result.rb', line 4

def counts
  @counts
end

#errorsObject

Returns the value of attribute errors.



4
5
6
# File 'lib/startupstats/response/api_result.rb', line 4

def errors
  @errors
end

#filingsObject

Returns the value of attribute filings.



4
5
6
# File 'lib/startupstats/response/api_result.rb', line 4

def filings
  @filings
end

#limitObject

Returns the value of attribute limit.



4
5
6
# File 'lib/startupstats/response/api_result.rb', line 4

def limit
  @limit
end

#startObject

Returns the value of attribute start.



4
5
6
# File 'lib/startupstats/response/api_result.rb', line 4

def start
  @start
end

#total_countObject

Returns the value of attribute total_count.



4
5
6
# File 'lib/startupstats/response/api_result.rb', line 4

def total_count
  @total_count
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/startupstats/response/api_result.rb', line 17

def success?
	( @errors.length == 0 )
end