Class: Boundy::Domain::Anterior

Inherits:
Object
  • Object
show all
Includes:
Plugin
Defined in:
lib/boundy/domain/anterior.rb

Overview

An Anterior domain datum has a beginning, but no end – hence, is anterior-domain.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Plugin

included

Constructor Details

#initialize(datum) ⇒ Anterior

Returns a new instance of Anterior.



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/boundy/domain/anterior.rb', line 22

def initialize(datum)
  if datum.nil?
    raise
  end

  @from = case datum
          when Boundy::Bound
            datum
          else
            Boundy::Bound.new(datum)
          end
  @to = Boundy::Bound::Infinite::Above.new
end

Class Method Details

.builderObject



10
11
12
13
14
15
16
17
18
# File 'lib/boundy/domain/anterior.rb', line 10

def self.builder
  {
    bounds: {
      from: Boundy::Bound, 
      to: Boundy::Bound::Infinite::Above
    },
    builder: Proc.new {|b,e| self.new(b) }
  }
end

Instance Method Details

#cuteObject



36
37
38
# File 'lib/boundy/domain/anterior.rb', line 36

def cute
  "[#{@from.datum}, infinity]"
end

#inspectObject



40
41
42
# File 'lib/boundy/domain/anterior.rb', line 40

def inspect
  "#<#{self.class.name} bounded below by #{@from.inspect}>"
end