Class: DAP::Relation::OneOf
- Inherits:
-
Object
- Object
- DAP::Relation::OneOf
- Defined in:
- lib/dap/relation.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
-
#initialize(types) ⇒ OneOf
constructor
A new instance of OneOf.
- #with(key) ⇒ Object
Constructor Details
#initialize(types) ⇒ OneOf
Returns a new instance of OneOf.
18 19 20 21 |
# File 'lib/dap/relation.rb', line 18 def initialize(types) types.values.each { |k| DAP::Relation.supported!(k) } @types = types end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
16 17 18 |
# File 'lib/dap/relation.rb', line 16 def key @key end |
#types ⇒ Object (readonly)
Returns the value of attribute types.
16 17 18 |
# File 'lib/dap/relation.rb', line 16 def types @types end |
Instance Method Details
#with(key) ⇒ Object
23 24 25 26 |
# File 'lib/dap/relation.rb', line 23 def with(key) @key = key self end |