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)
@@i =
NumberingFormat.new(:i, 1)
@@aa =
NumberingFormat.new(:aa, 2)
@@unknown =
NumberingFormat.new(:unknown, 3)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#ordinalObject

Returns the value of attribute ordinal.



158
159
160
# File 'lib/slaw/parse/blocklists.rb', line 158

def ordinal
  @ordinal
end

#typeObject

Returns the value of attribute type.



158
159
160
# File 'lib/slaw/parse/blocklists.rb', line 158

def type
  @type
end

Class Method Details

.aObject



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

def self.a; @@a; end

.aaObject



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

def self.aa; @@aa; end

.iObject



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

def self.i; @@i; end

.unknownObject



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

Returns:

  • (Boolean)


165
166
167
# File 'lib/slaw/parse/blocklists.rb', line 165

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

#to_sObject



173
174
175
# File 'lib/slaw/parse/blocklists.rb', line 173

def to_s
  @type.to_s
end