Class: Val::Claim::Instance

Inherits:
Object show all
Defined in:
lib/val.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value) ⇒ Instance

Returns a new instance of Instance.



91
92
93
94
95
96
97
# File 'lib/val.rb', line 91

def initialize type, value
  @type, @value = type, value
  @ok = type.proc === value
rescue
  @error = $!
  @ok = false
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



89
90
91
# File 'lib/val.rb', line 89

def error
  @error
end

#typeObject (readonly)

Returns the value of attribute type.



89
90
91
# File 'lib/val.rb', line 89

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



89
90
91
# File 'lib/val.rb', line 89

def value
  @value
end

Instance Method Details

#ok?Boolean

Returns:

  • (Boolean)


99
100
101
# File 'lib/val.rb', line 99

def ok?
  @ok
end