Class: Threatinator::Decoder
- Inherits:
-
Object
- Object
- Threatinator::Decoder
- Defined in:
- lib/threatinator/decoder.rb
Overview
Decodes/Extracts data from an input IO, producing a new IO. The decoder is initialized with a configuration, and then #decode is called upon an IO object.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#encoding ⇒ Object
readonly
Returns the value of attribute encoding.
Instance Method Summary collapse
-
#decode(io) ⇒ IO
Decodes an input IO, returning a brand new IO.
-
#initialize(opts = {}) ⇒ Decoder
constructor
A new instance of Decoder.
Constructor Details
#initialize(opts = {}) ⇒ Decoder
Returns a new instance of Decoder.
11 12 13 |
# File 'lib/threatinator/decoder.rb', line 11 def initialize(opts = {}) @encoding = opts[:encoding] || "utf-8" end |
Instance Attribute Details
#encoding ⇒ Object (readonly)
Returns the value of attribute encoding.
6 7 8 |
# File 'lib/threatinator/decoder.rb', line 6 def encoding @encoding end |
Instance Method Details
#decode(io) ⇒ IO
Decodes an input IO, returning a brand new IO.
18 19 20 21 22 |
# File 'lib/threatinator/decoder.rb', line 18 def decode(io) #:nocov: raise NotImplementedError.new("#{self.class}#decode not implemented!") #:nocov: end |