Class: Recog::Fingerprint::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/recog/fingerprint/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, attributes = []) ⇒ Test

Returns a new instance of Test.



6
7
8
9
10
11
12
13
14
# File 'lib/recog/fingerprint/test.rb', line 6

def initialize(content, attributes = [])
  @attributes = attributes

  @content = if @attributes['_encoding'] && @attributes['_encoding'] == 'base64'
               content.to_s.unpack1('m*')
             else
               content
             end
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



4
5
6
# File 'lib/recog/fingerprint/test.rb', line 4

def attributes
  @attributes
end

#contentObject

Returns the value of attribute content.



4
5
6
# File 'lib/recog/fingerprint/test.rb', line 4

def content
  @content
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/recog/fingerprint/test.rb', line 16

def to_s
  content
end