Class: FCC::Station::Cache
- Inherits:
-
Object
- Object
- FCC::Station::Cache
- Defined in:
- lib/fcc/station/cache.rb
Instance Attribute Summary collapse
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
- #find(fcc_id) ⇒ Object
-
#initialize(service) ⇒ Cache
constructor
A new instance of Cache.
- #inspect ⇒ Object
- #results ⇒ Object
Constructor Details
#initialize(service) ⇒ Cache
Returns a new instance of Cache.
10 11 12 13 |
# File 'lib/fcc/station/cache.rb', line 10 def initialize(service) @service = service @store = Station::ExtendedInfo.new(@service) end |
Instance Attribute Details
#store ⇒ Object (readonly)
Returns the value of attribute store.
8 9 10 |
# File 'lib/fcc/station/cache.rb', line 8 def store @store end |
Instance Method Details
#find(fcc_id) ⇒ Object
15 16 17 |
# File 'lib/fcc/station/cache.rb', line 15 def find(fcc_id) results.detect { |r| r[:fcc_id].to_s == fcc_id.to_s } end |
#inspect ⇒ Object
24 25 26 |
# File 'lib/fcc/station/cache.rb', line 24 def inspect "<Cache @service=#{service}>" end |
#results ⇒ Object
19 20 21 22 |
# File 'lib/fcc/station/cache.rb', line 19 def results #TODO: add redis caching tie-in because this query is molasses @store.all_results.parsed_response end |