Class: Twitter::GeoResults
- Inherits:
-
Object
- Object
- Twitter::GeoResults
- Includes:
- Enumerable, Utils
- Defined in:
- lib/twitter/geo_results.rb
Overview
Represents a collection of geo search results
Instance Attribute Summary collapse
-
#attrs ⇒ Hash
(also: #to_h)
readonly
The raw attributes hash.
Instance Method Summary collapse
-
#initialize(attrs = nil) ⇒ Twitter::GeoResults
constructor
Initializes a new GeoResults object.
-
#token ⇒ String
Returns the token for pagination.
Methods included from Utils
Methods included from Enumerable
Constructor Details
#initialize(attrs = nil) ⇒ Twitter::GeoResults
Initializes a new GeoResults object
41 42 43 44 45 46 47 48 |
# File 'lib/twitter/geo_results.rb', line 41 def initialize(attrs = nil) @attrs = attrs || {} empty_hash = {} # : Hash[Symbol, untyped] empty_array = [] # : Array[untyped] @collection = @attrs.fetch(:result, empty_hash).fetch(:places, empty_array).collect do |place| # steep:ignore ArgumentTypeMismatch Place.new(place) end end |
Instance Attribute Details
#attrs ⇒ Hash (readonly) Also known as: to_h
The raw attributes hash
16 17 18 |
# File 'lib/twitter/geo_results.rb', line 16 def attrs @attrs end |
Instance Method Details
#token ⇒ String
Returns the token for pagination
56 57 58 |
# File 'lib/twitter/geo_results.rb', line 56 def token @attrs[:token] end |