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.
165 166 167 168 |
# File 'lib/db_rotator.rb', line 165 def initialize(name, schema_regex) @name = name @schema_regex = schema_regex end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
163 164 165 |
# File 'lib/db_rotator.rb', line 163 def name @name end |
Instance Method Details
#to_date ⇒ Object
170 171 172 173 174 175 |
# File 'lib/db_rotator.rb', line 170 def to_date Date.strptime( name.match(@schema_regex)[1], TIME_FORMAT ) end |