Class: Slaw::Parse::Blocklists::NumberingFormat

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/slaw/parse/blocklists.rb

Constant Summary collapse

@@a =
NumberingFormat.new(:a, 0)
@@A =
NumberingFormat.new(:a, 1)
@@i =
NumberingFormat.new(:i, 2)
@@I =
NumberingFormat.new(:I, 3)
@@aa =
NumberingFormat.new(:aa, 4)
@@AA =
NumberingFormat.new(:AA, 5)
@@unknown =
NumberingFormat.new(:unknown, 9)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, ordinal) ⇒ NumberingFormat

Returns a new instance of NumberingFormat.



186
187
188
189
# File 'lib/slaw/parse/blocklists.rb', line 186

def initialize(type, ordinal)
  @type = type
  @ordinal = ordinal
end

Instance Attribute Details

#ordinalObject

Returns the value of attribute ordinal.



184
185
186
# File 'lib/slaw/parse/blocklists.rb', line 184

def ordinal
  @ordinal
end

#typeObject

Returns the value of attribute type.



184
185
186
# File 'lib/slaw/parse/blocklists.rb', line 184

def type
  @type
end

Class Method Details

.AObject



212
# File 'lib/slaw/parse/blocklists.rb', line 212

def self.A; @@A; end

.aObject



211
# File 'lib/slaw/parse/blocklists.rb', line 211

def self.a; @@a; end

.aaObject



215
# File 'lib/slaw/parse/blocklists.rb', line 215

def self.aa; @@aa; end

.AAObject



216
# File 'lib/slaw/parse/blocklists.rb', line 216

def self.AA; @@AA; end

.IObject



214
# File 'lib/slaw/parse/blocklists.rb', line 214

def self.I; @@I; end

.iObject



213
# File 'lib/slaw/parse/blocklists.rb', line 213

def self.i; @@i; end

.unknownObject



217
# File 'lib/slaw/parse/blocklists.rb', line 217

def self.unknown; @@unknown; end

Instance Method Details

#<=>(other) ⇒ Object



195
196
197
# File 'lib/slaw/parse/blocklists.rb', line 195

def <=>(other)
  self.ordinal <=> other.ordinal
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


191
192
193
# File 'lib/slaw/parse/blocklists.rb', line 191

def eql?(other)
  self.ordinal == other.ordinal
end

#to_sObject



199
200
201
# File 'lib/slaw/parse/blocklists.rb', line 199

def to_s
  @type.to_s
end