Class: TokyoMetro::Rake::Rails::Deploy::Heroku::Csv::Command::MetaClass
- Inherits:
-
Object
- Object
- TokyoMetro::Rake::Rails::Deploy::Heroku::Csv::Command::MetaClass
- Defined in:
- lib/tokyo_metro/rake/rails/deploy/heroku/csv/command/meta_class.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Table
Instance Attribute Summary collapse
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time = nil) ⇒ MetaClass
constructor
A new instance of MetaClass.
- #to_s ⇒ Object
Constructor Details
#initialize(time = nil) ⇒ MetaClass
Returns a new instance of MetaClass.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/tokyo_metro/rake/rails/deploy/heroku/csv/command/meta_class.rb', line 3 def initialize( time = nil ) # tables_from_file = ::File.open( "#{ ::Rails.root }/db/tables.txt" , "r:utf-8" ).read tables_from_file = ::ActiveRecord::Base.connection.tables.sort # tables_from_file = open( "#{ ::Rails.root }/db/tables.txt" , "r:utf-8" ).read.split( /\n/ ) @tables = tables_from_file.map { | table | Table.new( table ) } @commands = ::Array.new set_time( time ) optional_setting_of_initializer ::FileUtils.mkdir_p( @dirname ) unless ::Dir.exist?( @dirname ) puts "-" * 32 + " Time: #{ @time }" puts "-" * 32 + " Dirname: #{ @dirname }" puts "" end |
Instance Attribute Details
#time ⇒ Object (readonly)
Returns the value of attribute time.
19 20 21 |
# File 'lib/tokyo_metro/rake/rails/deploy/heroku/csv/command/meta_class.rb', line 19 def time @time end |
Instance Method Details
#to_s ⇒ Object
21 22 23 24 25 26 |
# File 'lib/tokyo_metro/rake/rails/deploy/heroku/csv/command/meta_class.rb', line 21 def to_s set_first_settings_to_s set_commands_for_db @commands.flatten end |