Class: Nestling::Collection

Inherits:
Array
  • Object
show all
Defined in:
lib/nestling/collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, *args) ⇒ Collection

Returns a new instance of Collection.



7
8
9
10
11
12
13
14
# File 'lib/nestling/collection.rb', line 7

def initialize(options = {}, *args)
  options = Nestling::Hash.new(options).symbolize_keys!
  @results    = options[:results] || options[:total]
  @start      = options[:start]
  @session_id = options[:session_id]
  @type       = options[:type]
  super *args
end

Instance Attribute Details

#resultsObject (readonly) Also known as: total

Returns the value of attribute results.



3
4
5
# File 'lib/nestling/collection.rb', line 3

def results
  @results
end

#session_idObject (readonly)

Returns the value of attribute session_id.



3
4
5
# File 'lib/nestling/collection.rb', line 3

def session_id
  @session_id
end

#startObject (readonly)

Returns the value of attribute start.



3
4
5
# File 'lib/nestling/collection.rb', line 3

def start
  @start
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/nestling/collection.rb', line 3

def type
  @type
end