Class: Racf::Pagers::CachedIspfPager
- Inherits:
-
Object
- Object
- Racf::Pagers::CachedIspfPager
- Defined in:
- lib/racf/pagers/cached_ispf_pager.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
Instance Method Summary collapse
-
#initialize(command, uncached_pager = IspfPager) ⇒ CachedIspfPager
constructor
A new instance of CachedIspfPager.
- #run(*arguments) ⇒ Object
Constructor Details
#initialize(command, uncached_pager = IspfPager) ⇒ CachedIspfPager
Returns a new instance of CachedIspfPager.
8 9 10 11 12 |
# File 'lib/racf/pagers/cached_ispf_pager.rb', line 8 def initialize(command, uncached_pager=IspfPager) @command = command @pager = uncached_pager.new @command @cache = Hash.new { |hash, key| hash[key] = {} } end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
6 7 8 |
# File 'lib/racf/pagers/cached_ispf_pager.rb', line 6 def cache @cache end |
Instance Method Details
#run(*arguments) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/racf/pagers/cached_ispf_pager.rb', line 14 def run(*arguments) resources = @command.extract_resources(arguments) if resources.empty? @pager.run(*arguments) else run_cached(arguments, resources) end end |