Class: Boundy::Formatters::Sql::Domain::Finite

Inherits:
Object
  • Object
show all
Includes:
Boundy::Formatter::Sql::Domain::Plugin
Defined in:
lib/boundy/formatters/sql/domain/finite.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Boundy::Formatter::Sql::Domain::Plugin

for, included

Constructor Details

#initialize(domain, name) ⇒ Finite

Returns a new instance of Finite.



13
14
15
16
17
# File 'lib/boundy/formatters/sql/domain/finite.rb', line 13

def initialize(domain, name)
  @name = name
  @from_formatter = Boundy::Formatter::Sql.new(domain.from, name)
  @to_formatter = Boundy::Formatter::Sql.new(domain.to, name)
end

Class Method Details

.typeObject



7
8
9
# File 'lib/boundy/formatters/sql/domain/finite.rb', line 7

def self.type
  Boundy::Domain::Finite
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/boundy/formatters/sql/domain/finite.rb', line 19

def to_s
  "#{@name} >= '#{@from_formatter.to_s}' AND #{@name} <= '#{@to_formatter.to_s}'"
end