Class: Val::Message
Defined Under Namespace
Instance Attribute Summary collapse
-
#arrows ⇒ Object
readonly
Returns the value of attribute arrows.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #===(value) ⇒ Object
- #[](value) ⇒ Object
- #arrow(&block) ⇒ Object
-
#initialize(name) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(name) ⇒ Message
Returns a new instance of Message.
205 206 207 208 |
# File 'lib/val.rb', line 205 def initialize name @name = name @arrows = [] end |
Instance Attribute Details
#arrows ⇒ Object (readonly)
Returns the value of attribute arrows.
210 211 212 |
# File 'lib/val.rb', line 210 def arrows @arrows end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
210 211 212 |
# File 'lib/val.rb', line 210 def name @name end |
Instance Method Details
#===(value) ⇒ Object
216 217 218 |
# File 'lib/val.rb', line 216 def === value self[value].ok? end |
#[](value) ⇒ Object
220 221 222 |
# File 'lib/val.rb', line 220 def [] value Instance.new self, value end |
#arrow(&block) ⇒ Object
212 213 214 |
# File 'lib/val.rb', line 212 def arrow &block @arrows << Arrow.new(@name, &block) end |