Class: DBRotator::Schema
- Inherits:
-
Object
- Object
- DBRotator::Schema
- Defined in:
- lib/db_rotator.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, schema_regex) ⇒ Schema
constructor
A new instance of Schema.
- #to_date ⇒ Object
Constructor Details
#initialize(name, schema_regex) ⇒ Schema
Returns a new instance of Schema.
146 147 148 149 |
# File 'lib/db_rotator.rb', line 146 def initialize(name, schema_regex) @name = name @schema_regex = schema_regex end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
144 145 146 |
# File 'lib/db_rotator.rb', line 144 def name @name end |
Instance Method Details
#to_date ⇒ Object
151 152 153 154 155 156 |
# File 'lib/db_rotator.rb', line 151 def to_date Date.strptime( name.match(@schema_regex)[1], TIME_FORMAT ) end |