Class: Camille::Checked

Inherits:
Object
  • Object
show all
Defined in:
lib/camille/checked.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fingerprint, value) ⇒ Checked

Returns a new instance of Checked.



5
6
7
8
# File 'lib/camille/checked.rb', line 5

def initialize fingerprint, value
  @fingerprint = fingerprint
  @value = value
end

Instance Attribute Details

#fingerprintObject (readonly)

Returns the value of attribute fingerprint.



3
4
5
# File 'lib/camille/checked.rb', line 3

def fingerprint
  @fingerprint
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/camille/checked.rb', line 3

def value
  @value
end

Instance Method Details

#checked?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/camille/checked.rb', line 10

def checked?
  true
end

#renderObject



18
19
20
21
22
23
24
# File 'lib/camille/checked.rb', line 18

def render
  if @value.instance_of? Camille::Rendered
    @value
  else
    Camille::Rendered.new(@fingerprint, JSON.dump(@value))
  end
end

#type_error?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/camille/checked.rb', line 14

def type_error?
  false
end