Class: RedShift::State
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#persist_name ⇒ Object
readonly
Returns the value of attribute persist_name.
Class Method Summary collapse
Instance Method Summary collapse
- #_dump(depth) ⇒ Object
-
#initialize(n, context) ⇒ State
constructor
A new instance of State.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(n, context) ⇒ State
4 5 6 7 8 |
# File 'lib/redshift/state.rb', line 4 def initialize n, context @name = n @persist_name = "#{context}::#{n}".intern @context = context end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/redshift/state.rb', line 2 def name @name end |
#persist_name ⇒ Object (readonly)
Returns the value of attribute persist_name.
2 3 4 |
# File 'lib/redshift/state.rb', line 2 def persist_name @persist_name end |
Class Method Details
._load(str) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/redshift/state.rb', line 14 def self._load str pn = str.intern ## could cache this lookup in a hash ObjectSpace.each_object(State) { |st| if st.persist_name == pn return st end } end |
Instance Method Details
#_dump(depth) ⇒ Object
10 11 12 |
# File 'lib/redshift/state.rb', line 10 def _dump depth @persist_name.to_s end |
#inspect ⇒ Object
28 29 30 |
# File 'lib/redshift/state.rb', line 28 def inspect "<#{@name}>" end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/redshift/state.rb', line 24 def to_s @name.to_s end |