Class: Awsum::Ec2::State
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(code, name) ⇒ State
constructor
A new instance of State.
Constructor Details
#initialize(code, name) ⇒ State
6 7 8 9 |
# File 'lib/awsum/ec2/state.rb', line 6 def initialize(code, name) @code = code.to_i @name = name end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/awsum/ec2/state.rb', line 4 def code @code end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/awsum/ec2/state.rb', line 4 def name @name end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/awsum/ec2/state.rb', line 11 def ==(other) if other.is_a?(Numeric) @code == other elsif other.is_a?(String) @name == other else @code = other.code && @name == other.name end end |