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)


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

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


80
81
82
# File 'lib/stupidedi/schema/repeat_count.rb', line 80

def unbounded
  RepeatCount::Unbounded
end