Class: Camille::Checked
- Inherits:
-
Object
- Object
- Camille::Checked
- Defined in:
- lib/camille/checked.rb
Instance Attribute Summary collapse
-
#fingerprint ⇒ Object
readonly
Returns the value of attribute fingerprint.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #checked? ⇒ Boolean
-
#initialize(fingerprint, value) ⇒ Checked
constructor
A new instance of Checked.
- #render ⇒ Object
- #type_error? ⇒ Boolean
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
#fingerprint ⇒ Object (readonly)
Returns the value of attribute fingerprint.
3 4 5 |
# File 'lib/camille/checked.rb', line 3 def fingerprint @fingerprint end |
#value ⇒ Object (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
10 11 12 |
# File 'lib/camille/checked.rb', line 10 def checked? true end |
#render ⇒ Object
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
14 15 16 |
# File 'lib/camille/checked.rb', line 14 def type_error? false end |