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.


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

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

  if @attributes['_encoding'] && @attributes['_encoding'] == 'base64'
    @content = content.to_s.unpack('m*').first
  else
    @content = 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.


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

def content
  @content
end

Instance Method Details

#to_sObject


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

def to_s
  content
end