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
Constant Summary
Constants inherited from Stupidedi::Schema::RepeatCount
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 ⇒ Object
Methods inherited from Stupidedi::Schema::RepeatCount
Constructor Details
#initialize(max) ⇒ Bounded
Returns a new instance of Bounded.
17 18 19 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 17 def initialize(max) @max = max end |
Instance Attribute Details
#max ⇒ Integer (readonly)
15 16 17 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 15 def max @max end |
Instance Method Details
#exclude?(n) ⇒ Boolean
25 26 27 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 25 def exclude?(n) n > @max end |
#include?(n) ⇒ Boolean
21 22 23 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 21 def include?(n) n <= @max end |
#inspect ⇒ Object
29 30 31 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 29 def inspect @max.to_s end |