Class: Stupidedi::Schema::RepeatCount

Inherits:
Object
  • Object
show all
Defined in:
lib/stupidedi/schema/repeat_count.rb

Direct Known Subclasses

Bounded

Defined Under Namespace

Classes: Bounded

Constructors collapse

Class Method Details

.bounded(n)



67
68
69
70
71
72
73
74
75
76
# File 'lib/stupidedi/schema/repeat_count.rb', line 67

def bounded(n)
  if n < 1
    raise Exception::InvalidSchemaError,
      "n must be positive"
  elsif n == 1
    RepeatCount::Once
  else
    RepeatCount::Bounded.new(n)
  end
end

.unbounded



78
79
80
# File 'lib/stupidedi/schema/repeat_count.rb', line 78

def unbounded
  RepeatCount::Unbounded
end