Class: Coder::State

Inherits:
Object
  • Object
show all
Defined in:
lib/states/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ State

Returns a new instance of State.



5
6
7
8
# File 'lib/states/state.rb', line 5

def initialize(args)
  self.code = args[:code].to_s
  self.name = args[:name]
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



3
4
5
# File 'lib/states/state.rb', line 3

def code
  @code
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/states/state.rb', line 3

def name
  @name
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/states/state.rb', line 10

def to_s
  name
end