Class: Pubid::Nist::Stage

Inherits:
Object
  • Object
show all
Defined in:
lib/pubid/nist/stage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stage) ⇒ Stage

Returns a new instance of Stage.



7
8
9
# File 'lib/pubid/nist/stage.rb', line 7

def initialize(stage)
  @stage = stage
end

Instance Attribute Details

#stageObject

Returns the value of attribute stage.



5
6
7
# File 'lib/pubid/nist/stage.rb', line 5

def stage
  @stage
end

Instance Method Details

#nil?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/pubid/nist/stage.rb', line 24

def nil?
  @stage.nil?
end

#to_s(format = :short) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/pubid/nist/stage.rb', line 11

def to_s(format = :short)
  return "" if nil?

  case format
  when :short
    "(#{@stage})"
  when :mr
    @stage
  else
    STAGES[@stage]
  end
end