assert_valid_keys

assert_valid_keys(*valid_keys) Instance Public methods Validate all keys in a hash match *valid_keys, raising ArgumentError on a mismatch. Note that keys are NOT treated indifferently, meaning if you use strings for keys but assert symbols as keys, this will fail. { name: 'Rob', years: '28' }.assert_valid_keys(:name, :age) # => raises "ArgumentError: Unknown key: :years. Valid keys are: :name, :age" { name: 'Rob', age: '28' }.assert_valid_keys('name', 'age') # => raises "Argu

call

call(env) Instance Public methods

insert_fixture

insert_fixture(fixture, table_name) Instance Public methods Inserts the given fixture into the table. Overridden in adapters that require something beyond a simple insert (eg. Oracle).

namespaced_path

namespaced_path() Instance Protected methods

rake_tasks

rake_tasks(&block) Instance Public methods If you try to define a set of rake tasks on the instance, these will get passed up to the rake tasks defined on the application's class.

beginning_of_day

beginning_of_day() Instance Public methods Returns a new Time representing the start of the day (0:00) midnight at_midnight at_beginning_of_day

seconds_until_end_of_day

seconds_until_end_of_day() Instance Public methods Returns the number of seconds until 23:59:59. DateTime.new(2012, 8, 29, 0, 0, 0).seconds_until_end_of_day # => 86399 DateTime.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 DateTime.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0

end_of_minute

end_of_minute() Instance Public methods Returns a new DateTime representing the end of the minute (hh:mm:59). at_end_of_minute

formatted_offset

formatted_offset(colon = true, alternate_utc_string = nil) Instance Public methods datetime = DateTime.civil(2000, 1, 1, 0, 0, 0, Rational(-6, 24)) datetime.formatted_offset # => â-06:00â datetime.formatted_offset(false) # => â-0600â

destination

destination(path) Instance Public methods Sets the destination of generator files: destination File.expand_path("../tmp", File.dirname(__FILE__))