Class: DAP::Relation::OneOf

Inherits:
Object
  • Object
show all
Defined in:
lib/dap/relation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



16
17
18
# File 'lib/dap/relation.rb', line 16

def key
  @key
end

#typesObject (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