Class: Stupidedi::Schema::RepeatCount::Bounded
- Inherits:
-
Stupidedi::Schema::RepeatCount
- Object
- Stupidedi::Schema::RepeatCount
- Stupidedi::Schema::RepeatCount::Bounded
- Extended by:
- Forwardable
- 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.
14 15 16 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 14 def initialize(max) @max = max end |
Instance Attribute Details
#max ⇒ Integer (readonly)
12 13 14 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 12 def max @max end |
Instance Method Details
#exclude?(n) ⇒ Boolean
22 23 24 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 22 def exclude?(n) n > @max end |
#include?(n) ⇒ Boolean
18 19 20 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 18 def include?(n) n <= @max end |
#inspect ⇒ Object
26 27 28 |
# File 'lib/stupidedi/schema/repeat_count.rb', line 26 def inspect @max.to_s end |