Class: Val::Message::Instance

Inherits:
Object
  • 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.



261
262
263
264
265
266
# File 'lib/val.rb', line 261

def initialize type, value
  @name = type.name
  @available = value.respond_to? @name
  @arrows = type.arrows.map &[value]
  @ok = @available && @arrows.all?(&:ok?)
end

Instance Attribute Details

#arrowsObject (readonly)

Returns the value of attribute arrows.



268
269
270
# File 'lib/val.rb', line 268

def arrows
  @arrows
end

#nameObject (readonly)

Returns the value of attribute name.



268
269
270
# File 'lib/val.rb', line 268

def name
  @name
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


270
271
272
# File 'lib/val.rb', line 270

def available?
  @available
end

#ok?Boolean

Returns:

  • (Boolean)


274
275
276
# File 'lib/val.rb', line 274

def ok?
  @ok
end