Class: XMigra::Index
Instance Attribute Summary collapse
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #definition_sql ⇒ Object
- #id ⇒ Object
-
#initialize(index_info) ⇒ Index
constructor
A new instance of Index.
Constructor Details
#initialize(index_info) ⇒ Index
Returns a new instance of Index.
5 6 7 8 |
# File 'lib/xmigra/index.rb', line 5 def initialize(index_info) @name = index_info['name'].dup.freeze @definition = index_info['sql'].dup.freeze end |
Instance Attribute Details
#file_path ⇒ Object
Returns the value of attribute file_path.
12 13 14 |
# File 'lib/xmigra/index.rb', line 12 def file_path @file_path end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/xmigra/index.rb', line 10 def name @name end |
Instance Method Details
#definition_sql ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/xmigra/index.rb', line 18 def definition_sql if Plugin.active @definition.dup.tap do |sql| Plugin.active.amend_source_sql(sql) end else @definition end end |
#id ⇒ Object
14 15 16 |
# File 'lib/xmigra/index.rb', line 14 def id XMigra.secure_digest(@definition) end |