Class: Rack::PageSpeed::Filters::Base
- Inherits:
-
Object
- Object
- Rack::PageSpeed::Filters::Base
- Defined in:
- lib/rack/pagespeed/filters/base.rb
Direct Known Subclasses
Constant Summary collapse
- @@subclasses =
[]
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
- .available_filters ⇒ Object
- .inherited(klass) ⇒ Object
- .name(_name = nil) ⇒ Object
- .priority(_number = nil) ⇒ Object
- .requires_store ⇒ Object
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
8 9 10 |
# File 'lib/rack/pagespeed/filters/base.rb', line 8 def initialize = {} @options = end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
5 6 7 |
# File 'lib/rack/pagespeed/filters/base.rb', line 5 def document @document end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/rack/pagespeed/filters/base.rb', line 5 def @options end |
Class Method Details
.available_filters ⇒ Object
17 18 19 |
# File 'lib/rack/pagespeed/filters/base.rb', line 17 def available_filters @@subclasses end |
.inherited(klass) ⇒ Object
13 14 15 |
# File 'lib/rack/pagespeed/filters/base.rb', line 13 def inherited klass @@subclasses << klass end |
.name(_name = nil) ⇒ Object
29 30 31 |
# File 'lib/rack/pagespeed/filters/base.rb', line 29 def name _name = nil _name ? @name = _name : @name ||= underscore(to_s) end |
.priority(_number = nil) ⇒ Object
33 34 35 |
# File 'lib/rack/pagespeed/filters/base.rb', line 33 def priority _number = nil _number ? @priority = _number.to_i : @priority end |
.requires_store ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/rack/pagespeed/filters/base.rb', line 21 def requires_store instance_eval do def new = {} [:store] ? super() : raise("#{name} requires :store to be specified.") end end end |