Class: StartupStats::ApiResult
- Inherits:
-
Object
- Object
- StartupStats::ApiResult
- Defined in:
- lib/startupstats/response/api_result.rb
Instance Attribute Summary collapse
-
#counts ⇒ Object
Returns the value of attribute counts.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#filings ⇒ Object
Returns the value of attribute filings.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#start ⇒ Object
Returns the value of attribute start.
-
#total_count ⇒ Object
Returns the value of attribute total_count.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ ApiResult
constructor
include Enumerable.
- #success? ⇒ Boolean
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
#counts ⇒ Object
Returns the value of attribute counts.
4 5 6 |
# File 'lib/startupstats/response/api_result.rb', line 4 def counts @counts end |
#errors ⇒ Object
Returns the value of attribute errors.
4 5 6 |
# File 'lib/startupstats/response/api_result.rb', line 4 def errors @errors end |
#filings ⇒ Object
Returns the value of attribute filings.
4 5 6 |
# File 'lib/startupstats/response/api_result.rb', line 4 def filings @filings end |
#limit ⇒ Object
Returns the value of attribute limit.
4 5 6 |
# File 'lib/startupstats/response/api_result.rb', line 4 def limit @limit end |
#start ⇒ Object
Returns the value of attribute start.
4 5 6 |
# File 'lib/startupstats/response/api_result.rb', line 4 def start @start end |
#total_count ⇒ Object
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
17 18 19 |
# File 'lib/startupstats/response/api_result.rb', line 17 def success? ( @errors.length == 0 ) end |