Class: Val
Defined Under Namespace
Modules: CoreExt, DSL Classes: Claim, Instance, Key, Message
Constant Summary collapse
- Bool =
new { OR(true, false) }
- NotNil =
new { NOT :nil? }
Instance Attribute Summary collapse
-
#claims ⇒ Object
readonly
Returns the value of attribute claims.
Instance Method Summary collapse
- #===(value) ⇒ Object
- #[](value) ⇒ Object
-
#initialize(&block) ⇒ Val
constructor
A new instance of Val.
- #to_val ⇒ Object
Methods included from DSL
#NOT, #OR, #is, #is_a, #key, #m, #val
Constructor Details
#initialize(&block) ⇒ Val
Returns a new instance of Val.
44 45 46 47 |
# File 'lib/val.rb', line 44 def initialize &block @claims = [] instance_exec &block if block_given? end |
Instance Attribute Details
#claims ⇒ Object (readonly)
Returns the value of attribute claims.
49 50 51 |
# File 'lib/val.rb', line 49 def claims @claims end |
Instance Method Details
#===(value) ⇒ Object
55 56 57 |
# File 'lib/val.rb', line 55 def === value claims.all? &[:===, value] end |
#[](value) ⇒ Object
59 60 61 |
# File 'lib/val.rb', line 59 def [] value Instance.new self, value end |
#to_val ⇒ Object
51 52 53 |
# File 'lib/val.rb', line 51 def to_val self end |