Class: RestClient::Jogger::Filters::Base
- Inherits:
-
Object
- Object
- RestClient::Jogger::Filters::Base
- Includes:
- ActiveModel::Model
- Defined in:
- lib/rest_client/jogger/filters/base.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#data ⇒ Object
Returns the value of attribute data.
-
#filter_replacement ⇒ Object
Returns the value of attribute filter_replacement.
-
#filters ⇒ Object
Returns the value of attribute filters.
Class Method Summary collapse
Instance Method Summary collapse
- #filter ⇒ Object
-
#initialize(opts = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(opts = {}) ⇒ Base
Returns a new instance of Base.
18 19 20 21 |
# File 'lib/rest_client/jogger/filters/base.rb', line 18 def initialize(opts = {}) super self.data = data.dup end |
Instance Attribute Details
#content_type ⇒ Object
Returns the value of attribute content_type.
7 8 9 |
# File 'lib/rest_client/jogger/filters/base.rb', line 7 def content_type @content_type end |
#data ⇒ Object
Returns the value of attribute data.
7 8 9 |
# File 'lib/rest_client/jogger/filters/base.rb', line 7 def data @data end |
#filter_replacement ⇒ Object
Returns the value of attribute filter_replacement.
7 8 9 |
# File 'lib/rest_client/jogger/filters/base.rb', line 7 def filter_replacement @filter_replacement end |
#filters ⇒ Object
Returns the value of attribute filters.
7 8 9 |
# File 'lib/rest_client/jogger/filters/base.rb', line 7 def filters @filters end |
Class Method Details
.filter_class(content_type) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/rest_client/jogger/filters/base.rb', line 9 def self.filter_class(content_type) type = MIME::Types[content_type].first if type && type.sub_type == 'xml' RestClient::Jogger::Filters::Xml else RestClient::Jogger::Filters::Json end end |
Instance Method Details
#filter ⇒ Object
23 24 25 26 27 28 |
# File 'lib/rest_client/jogger/filters/base.rb', line 23 def filter filters.each do |filter| filter_data filter end data end |