Class: Bmg::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/bmg/type.rb

Constant Summary collapse

ANY =
Type.new

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(predicate = Predicate.tautology) ⇒ Type

Returns a new instance of Type.

Raises:

  • (ArgumentError)


4
5
6
7
# File 'lib/bmg/type.rb', line 4

def initialize(predicate = Predicate.tautology)
  @predicate = predicate
  raise ArgumentError if @predicate.nil?
end

Instance Attribute Details

#predicateObject (readonly)

Returns the value of attribute predicate.



8
9
10
# File 'lib/bmg/type.rb', line 8

def predicate
  @predicate
end

Instance Method Details

#[](attribute) ⇒ Object



12
13
14
# File 'lib/bmg/type.rb', line 12

def [](attribute)
  ANY
end

#allbut(butlist) ⇒ Object



16
17
18
# File 'lib/bmg/type.rb', line 16

def allbut(butlist)
  ANY
end

#autosummarize(by, summarization) ⇒ Object



24
25
26
# File 'lib/bmg/type.rb', line 24

def autosummarize(by, summarization)
  ANY
end

#autowrap(options) ⇒ Object



20
21
22
# File 'lib/bmg/type.rb', line 20

def autowrap(options)
  ANY
end

#constants(cs) ⇒ Object



28
29
30
# File 'lib/bmg/type.rb', line 28

def constants(cs)
  Type.new(@predicate & Predicate.eq(cs))
end

#extend(extension) ⇒ Object



32
33
34
# File 'lib/bmg/type.rb', line 32

def extend(extension)
  ANY
end

#image(right, as, on, options) ⇒ Object



36
37
38
# File 'lib/bmg/type.rb', line 36

def image(right, as, on, options)
  ANY
end

#matching(right, on) ⇒ Object



40
41
42
# File 'lib/bmg/type.rb', line 40

def matching(right, on)
  ANY
end

#project(attrlist) ⇒ Object



44
45
46
# File 'lib/bmg/type.rb', line 44

def project(attrlist)
  ANY
end

#rename(renaming) ⇒ Object



48
49
50
# File 'lib/bmg/type.rb', line 48

def rename(renaming)
  Type.new(@predicate.rename(renaming))
end

#restrict(predicate) ⇒ Object



52
53
54
# File 'lib/bmg/type.rb', line 52

def restrict(predicate)
  Type.new(@predicate & predicate)
end

#union(other) ⇒ Object



56
57
58
# File 'lib/bmg/type.rb', line 56

def union(other)
  Type.new(@predicate | other.predicate)
end