Class: Poleica::Converters::General

Inherits:
Object
  • Object
show all
Defined in:
lib/poleica/converters/general.rb

Overview

The General converter, it handles any file type and return null for unknown conversion

Constant Summary collapse

COMPATIBLE_TYPES =
[
  Types::All
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(polei) ⇒ General

Returns a new instance of General.



13
14
15
# File 'lib/poleica/converters/general.rb', line 13

def initialize(polei)
  @polei = polei
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



21
22
23
# File 'lib/poleica/converters/general.rb', line 21

def method_missing(method, *args, &block)
  super unless method =~ /^to_/
end

Instance Attribute Details

#poleiObject (readonly)

Returns the value of attribute polei.



11
12
13
# File 'lib/poleica/converters/general.rb', line 11

def polei
  @polei
end

Instance Method Details

#to_bin(_options = {}) ⇒ Object



17
18
19
# File 'lib/poleica/converters/general.rb', line 17

def to_bin(_options = {})
  File.binread(polei.path)
end