Class: Slaw::Parse::Blocklists::NumberingFormat
- Inherits:
-
Object
- Object
- Slaw::Parse::Blocklists::NumberingFormat
- Includes:
- Comparable
- Defined in:
- lib/slaw/parse/blocklists.rb
Constant Summary collapse
- @@a =
NumberingFormat.new(:a, 0)
- @@i =
NumberingFormat.new(:i, 1)
- @@aa =
NumberingFormat.new(:aa, 2)
- @@unknown =
NumberingFormat.new(:unknown, 3)
Instance Attribute Summary collapse
-
#ordinal ⇒ Object
Returns the value of attribute ordinal.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(type, ordinal) ⇒ NumberingFormat
constructor
A new instance of NumberingFormat.
- #to_s ⇒ Object
Constructor Details
#initialize(type, ordinal) ⇒ NumberingFormat
Returns a new instance of NumberingFormat.
160 161 162 163 |
# File 'lib/slaw/parse/blocklists.rb', line 160 def initialize(type, ordinal) @type = type @ordinal = ordinal end |
Instance Attribute Details
#ordinal ⇒ Object
Returns the value of attribute ordinal.
158 159 160 |
# File 'lib/slaw/parse/blocklists.rb', line 158 def ordinal @ordinal end |
#type ⇒ Object
Returns the value of attribute type.
158 159 160 |
# File 'lib/slaw/parse/blocklists.rb', line 158 def type @type end |
Class Method Details
.a ⇒ Object
182 |
# File 'lib/slaw/parse/blocklists.rb', line 182 def self.a; @@a; end |
.aa ⇒ Object
184 |
# File 'lib/slaw/parse/blocklists.rb', line 184 def self.aa; @@aa; end |
.i ⇒ Object
183 |
# File 'lib/slaw/parse/blocklists.rb', line 183 def self.i; @@i; end |
.unknown ⇒ Object
185 |
# File 'lib/slaw/parse/blocklists.rb', line 185 def self.unknown; @@unknown; end |
Instance Method Details
#<=>(other) ⇒ Object
169 170 171 |
# File 'lib/slaw/parse/blocklists.rb', line 169 def <=>(other) self.ordinal <=> other.ordinal end |
#eql?(other) ⇒ Boolean
165 166 167 |
# File 'lib/slaw/parse/blocklists.rb', line 165 def eql?(other) self.ordinal == other.ordinal end |
#to_s ⇒ Object
173 174 175 |
# File 'lib/slaw/parse/blocklists.rb', line 173 def to_s @type.to_s end |