Class: Stupidedi::Schema::RepeatCount::Bounded
- Inherits:
-
Stupidedi::Schema::RepeatCount
- Object
- Stupidedi::Schema::RepeatCount
- Stupidedi::Schema::RepeatCount::Bounded
- Includes:
- Comparable
- Defined in:
- lib/stupidedi/schema/repeat_count.rb
Instance Attribute Summary collapse
- #max ⇒ Integer readonly
Instance Method Summary collapse
- #exclude?(n) ⇒ Boolean
- #include?(n) ⇒ Boolean
-
#initialize(max) ⇒ Bounded
constructor
A new instance of Bounded.
- #inspect
Methods inherited from Stupidedi::Schema::RepeatCount
Constructor Details
#initialize(max) ⇒ Bounded
Returns a new instance of Bounded.
15 16 17 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 15 def initialize(max) @max = max end |
Instance Attribute Details
#max ⇒ Integer (readonly)
13 14 15 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 13 def max @max end |
Instance Method Details
#exclude?(n) ⇒ Boolean
23 24 25 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 23 def exclude?(n) n > @max end |
#include?(n) ⇒ Boolean
19 20 21 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 19 def include?(n) n <= @max end |
#inspect
27 28 29 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 27 def inspect @max.to_s end |