Module: ValueObject::DSL

Included in:
Base
Defined in:
lib/value_object/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allObject

Returns the value of attribute all.



9
10
11
# File 'lib/value_object/dsl.rb', line 9

def all
  @all
end

Instance Method Details

#find(key) ⇒ Object



3
4
5
6
7
# File 'lib/value_object/dsl.rb', line 3

def find(key)
  return unless key
  object = all.find { |v| v.key.to_s.eql?(key.to_s) }
  object || raise_invalid_value(key)
end