beginning_of_week

beginning_of_week(start_day = Date.beginning_of_week) Instance Public methods Returns a new date/time representing the start of this week on the given day. Week is assumed to start on start_day, default is Date.beginning_of_week or config.beginning_of_week when set. DateTime objects have their time set to 0:00. at_beginning_of_week

fatal?

fatal?() Instance Public methods Will the logger output FATAL messages?

render_to_string

render_to_string(*) Instance Public methods Overwrite #render_to_string because body can now be set to a rack body.

update

update(id, attributes) Instance Public methods Updates an object (or multiple objects) and saves it to the database, if validations pass. The resulting object is returned whether the object was saved successfully to the database or not. Parameters id - This should be the id or an array of ids to be updated. attributes - This should be a hash of attributes or an array of hashes. Examples # Updates one record Person.update(15, user_name: 'Samuel', group: 'expert') # Updates mu

new

new(*sequences) Class Public methods

connect

connect(tcp) Instance Public methods Connect to IO tcp, with context of the current certificate configuration

find

find(*args, &block) Instance Public methods Finds an object in the collection responding to the id. Uses the same rules as ActiveRecord::Base.find. Returns ActiveRecord::RecordNotFound error if the object cannot be found. class Person < ActiveRecord::Base has_many :pets end person.pets # => [ # #<Pet id: 1, name: "Fancy-Fancy", person_id: 1>, # #<Pet id: 2, name: "Spook", person_id: 1>, # #<Pet id: 3, name: "Choo-Choo", person_id: 1>

size 2

file.size â integer Instance Public methods Returns the size of file in bytes. File.new("testfile").size #=> 66

rsearch_with_length

rsearch_with_length(pat,start,stop=None) Instance Public methods

parse!

parse!(source, opts = {}) Instance Public methods Parse the JSON document source into a Ruby data structure and return it. The bang version of the parse method defaults to the more dangerous values for the opts hash, so be sure only to parse trusted source documents. opts can have the following keys: max_nesting: The maximum depth of nesting allowed in the parsed data structures. Enable depth checking with :max_nesting => anInteger. The parse! methods defaults to not doing max