Ruby Is An Open Source, Object-oriented Programming Language Created By Yukihiro “Matz” Matsumoto. Designed To Provide A Programming Language That Focuses On Simplicity And Productivity.
1.What is agile development
Agile methodology is an adaptive methodology, its people oriented.
Here are some of the other characteristics of the Agile methodology.
1. Delivery frequently.
2. Good ROI for client.
3. Test frequently.
4. Collaborative approach.
Agile methodology is on daily basis report. How much work we have completed on that day and howmuch work is still pending…it gives the clear picture but the req are not defined before hand itselfcompletely.. req will be changing.
2.Why Ruby on Rails?
There are lot of advantages of using Ruby on Rails(ROR)
1. DRY Principal
2. Convention over Configuration
3. Gems and Plug ins
4. Scaffolding
5. Pure OOP Concept
3.What is MVC? and how it Works?
MVC tends for Model-View-Controller, used by many languages like PHP, Perl, Python etc.
The flow goes like below image
SHOULD INSERT IMAGE
4.What is ORM in Rails?
ORM tends for Object-Relationship-Model, it means that your Classes are mapped to table in the database,and Objects are directly mapped to the rows in the table.
5.What is Ruby Gems?
Ruby Gem is a software package, commonly called a “gem”. Gem contains a packaged Ruby applicationor library. The Ruby Gems software itself allows you to easily download, install and manipulate gems onyour system.
6.What is Gem file and Gemfile.lock?
The Gem file is where you specify which gems you want to use, and lets you specify which versions. TheGemfile.lock file is where Bundler records the exact versions that were installed. This way, when the samelibrary/project is loaded on another machine, running bundle install will look at the Gemfile.lock andinstall the exact same versions, rather than just using the Gemfile and installing the most recent versions.(Running different versions on different machines could lead to broken tests, etc.) You shouldn’t ever haveto directly edit the lock file. Get more Explanations on Gem file here.
7.What is Active record
There are many reasons why Active Record is the smart choice simplified configuration and defaultassumptions (Convention over Configuration).
Associations among objects.
Automated mapping b/w tables and classes and b/w columns and attributes.
Data Validations.
Callbacks
Inheritance hierarchies.
Direct manipulation of data as well as schema objects.
Database abstraction through adapters.
Logging support.
Migration support.
8.How you run your Rails application without creating databases?
You can run your application by uncommenting the line in environment.rb path=> rootpathconf/environment.rb config.frameworks- = [action_web_service, :action_mailer, :active_record
9.What are the servers supported by ruby on rails?
Ruby Supports a number of Rails servers (Mongrel, WEBRICK, PHUSION, Passenger, etc..depending onthe specific platforms). For each Rails application project, Ruby Mine provides default Rails run/debugconfigurations for the production and development environments.
10.What is the difference between a plug-in and a gem?
A gem is just ruby code. It is installed on a machine and it’s available for all ruby applications running onthat machine. Rails, rake, json, rspec — are all examples of gems. Plug-in is also ruby code but it isinstalled in the application folder and only available for that specific application. Sitemap-generator, etc.
In general, since Rails works well with gems you will find that you would be mostly integrating with gemfiles and not plug in general. Most developers release their libraries as gems.
11.What is restful in rails
Stands for REpresentational State Transfer
12.What is passenger
Easy and robust deployment of ruby on rails app on apache and nix web servers passenger is anintermediate to run the ruby language in Linux server
13.What is request.xhr?
A request.xhr tells the controller that the new Ajax request has come, It always return TRUE or FALSE.
14.What is the Difference between Static and Dynamic Scaffolding?
The Syntax of Static Scaffold is like this:
ruby script/generate scaffold User Comment
Where Comment is the model and User is your controller, So all n all static scaffold takes 2 parameter i.e.your controller name and model name, whereas in dynamic scaffolding you have to fine controller andmodel one by one.
15.What is Session and Cookies?
Session: are used to store user information on the server side.
cookies: are used to store information on the browser side or we can say client side
Session : say session[:user] = "srikant" it remains when the browser is not closed
16.What is the difference between form_ for and form_ tag ?
form _tag and form for both are used to submit the form and it’s elements. The main difference betweenthese two is the way of managing objects related to that particular model is different.
17.We should use "form_for" tag for a specific model
It performs the "standard http post" which is having fields related to active record (model) objectsform_tag:
It creates a form as a normal form. form_tag also performs the "standard http post" without any modelbacked and has normal fields. This is mainly used when specific data need to be submitted via form. It justcreates a form tag and it is best used for non-model forms.
Example:
<% form_tag ‘/articles’ do -%>
<%= text_field_tag "article", "firstname" %>
<% end -%>
18.Difference between ruby 1.8.7 and 1.9.2
Ruby 1.9 – Major Features
Performance
Threads/Fibers
Encoding/Unicode
gems is (mostly) built-in now
if statements do not introduce scope in Ruby.
-{"a","b"} No Longer Supported
-Array.to_s Now Contains Punctuation
-Colon No Longer Valid In When Statements
19.What are the engines in mysql
In previous versions of MySQL, MyISAM was the default storage engine. In our experience, most usersnever changed the default settings. With MySQL 5.5, InnoDB becomes the default storage engine.
20.What is the difference between include and extend
include makes the module’s methods available to the instance of a class, while extend makes thesemethods available to the class itself.
When you use include, the module’s methods are added to the instances of the class. The log method is:
Not available at the class level
Available at the instance level
Not available at the class level again
When you use extend, the module’s methods are added to the class itself. The log method is:
Available at the class level. Not available at the instance level.
21.What is the difference between lambada and proc
proc and Lambda are used to create code blocks. After creating them, we can pass them around our code,just like variables.
22.How to call method dynamically
["foo", "bar"].each do |method|
MyClass.send(method)
end
23.How to create a method dynamically
class Message
[:hello, :goodbye].each do |method_name|
define_method method_name do |arg|
"#{method_name} #{arg}"
#irb
Message.instance_methods false #=> [:hello, :goodbye]
Message.new.hel o 'emre' #=> "hello emre" Message.new.goodbye 'emre' #=> "goodbye emre"
24.How to use Nested routes in ROR
The easiest way to create a nested route, is to use the :has_many keyword like that:
# /config/routes.rb
map.resources :projects, :has_many => :tasks
# and the correspondent task resource
map.resources :tasks
Adding the second routes, that defines a RESTful route to :tasks, depends if you would like to allow anaccess to the Task resource, without the project context, this is not a must.
25.What things we can define in the model?
There are lot of things you can define in models few are:
1. Validations (like validates_presence_of, numeracility_of, format_of etc.)
2. Relationships(like has_one, has_many, HABTM etc.)
3. Callbacks(like before_save, after_save, before_create etc.)
4. Suppose you installed a plugin say validation_group, So you can also define validation_group settings inyour model
5. ROR Queries in Sql
26.How many Types of Relationships does a Model has?
* (1) has_one
* (2) belongs_to
* (3) has_many
* (4) has_many :through
27.What is asset pipeline
asset pipeline which enables proper organization of CSS and JavaScript
28.What is observer in rails
Observer classes respond to life cycle callbacks to implement trigger-like behavior outside the originalclass. Rails observers are sweet, You can observe multiple models within a single observer
First, you need to generate your observer:
command – rails g observer Auditor
-observer classes are usually stored in app/models with the naming convention ofapp/models/audit_observer.rb.
In order to activate an observer, list it in the config.active_record.observers configuration setting in yourconfig/application.rb file. config.active_record.observers = :comment_observer, :signup_observer
Observers will not be invoked unless you define these in your application configuration.
29.What is rails sweeper
One sweeper can observe many Models, and any controller can have multiple sweepers.
30.Difference between -%> and %> in rails
The extra dash makes ERB not output the newline after the closing tag. There’s no difference in yourexample, but if you have something like this:
<% if true -%>
Hi
It’ll produce:
and not this:
31.Difference between render and redirect?
Redirect is a method that is used to issue the error message in case the page is not found or it issues a 302to the browser. Whereas, render is a method used to create the content.
-Redirect is used to tell the browser to issue a new request. Whereas, render only works in case thecontroller is being set up properly with the variables that needs to be rendered.
-Redirect is used when the user needs to redirect its response to some other page or URL. Whereas, rendermethod renders a page and generate a code of 200.
-Redirect is used as:
redirect_to: controller => 'users', :action => ‘new’
-Render is used as:
render: partial
render: new -> this will cal the template named as new.rhtml without the need of redirecting it to the newaction.
32.What is the use of rake db:reset
db:create——- creates the database for the current env
db:create:all ———creates the databases for all envs
db:drop ———-drops the database for the current env
db:drop:all ———-drops the databases for all envs
db:migrate ———-runs migrations for the current env that have not run yet
db:migrate:up ——–runs one specific migration
db:migrate:down ——-rolls back one specific migration
db:migrate:status —–shows current migration status
db:migrate:rollback —rolls back the last migration
db:forward ————advances the current schema version to the next one
db:seed (only) ———runs the db/seed.rb file
db:schema:load ————loads the schema into the current env’s database
db:schema:dump ———dumps the current env’s schema (and seems to create the db aswell)
db:setup ————-runs db:schema:load, db:seed
db:reset ———-runs db:drop db:setup
db:migrate:redo ———runs (db:migrate:down db:migrate:up) or (db:migrate:rollback
db:migrate:migrate) depending on the specified migration
db:migrate:reset ——runs db:drop db:create db:migrate
33.What is eagerloading
One way to improve performance is to reduce the number of database queries through eager loading.
-You can know where we need eager loading through 'Bullet' Gem
34.What are helpers and how to use helpers in ROR?
Helpers ("view helpers") are modules that provide methods which are automatically usable in your view.They provide shortcuts to commonly used display code and a way for you to keep the programming out ofyour views. The purpose of a helper is to simplify the view. It’s best if the view file (RHTML/RXML) isshort and sweet, so you can see the structure of the output.
35.What is Active Record?
Active Record are like Object Relational Mapping(ORM), where classes are mapped to table and objectsare mapped to columns in the table
36.Ruby Supports Single Inheritance/Multiple Inheritance or Both?
Ruby Supports only Single Inheritance
37.How many types of callbacks available in ROR?
* (-) save
* (-) valid
* (1) before validation
* (2) before_validation_on_create
* (-) validate
* (-) validate_on_create
* (3) after_validation
* (4) after_validation_on_create
* (5) before_save
* (6) before_create
* (-) create
* (7) after_create
* (8) after_save
38.How to use two database into a Single Application?
models are allowed one connection to a database at a time, per class. Ruby on Rails sets up the defaultconnection based on your database.yml configuration to automatically select development, test orproduction.
But, what if you want to access two or more databases – have 2+ connections open – at the
same time. Active Record requires that you subclass Active Record::Base.
That prevents you doing migrations from one database to another. It prevents you using one set of modelclasses on two or more databases with the same schema.
Magic Multi-Connections allows you to write your models once, and use them for multiple Rails databasesat the same time. How? Using magical name spacing.
To do this :
[A] sudo gem install magic_multi_connections
[B] require ‘magic_multi_connections’
Add the following to the bottom of your environment.rb file.
39.What is the difference between the Rails version 2 and 3?
* (1) Introduction of bundler (New way to manage your gem dependencies)
* (2) Gem file and Gemfile.lock (Where all your gem dependencies lies, instead of environment.rb)
* (3) A new .rb file in config/ folder, named as application.rb (Which has everything that previouslyenvironment.rb had)
* (4) Change in SQL Structure: Model. where(:activated => true)
* (5) All the mailer script will now be in app/mailers folder, earlier we kept inside app/models.
* (6) Rails3-UJS support. for links and forms to work as AJAX, instead of writing complex lines of
code, we write :remote => true
* (7) HTML 5 support.
* (8) Changes in the model based validation syntax: validates :name, :presence => true
* (9) Ability to install windows/ruby/ruby/development/production specific gems to Gem file.
group :production do gem ‘will _paginate 'end
40.What is bundler?
Bundler is a new concept introduced in Rails3, which helps to you manage your gems for the application.After specifying gems in your Gem file, you need to do a bundle install. If the gem is available in thesystem, bundle will use that else it will pick up from the rubygems.org.
41.What is the Newest approach for find(:all) in Rails 3?
Model. where(:activated => true)
42.What are the variable in ruby
1 Local Variables – foobar
2 Instance Variables – @foobar
3 Class Variables – @@foobar
4 Global Variables – $foobar
Name Begins With Variable Scope
$ A global variable
@ An instance variable
[a-z] or _ A local variable
[A-Z] A constant
@@ A class variable
43.Difference between "and" and && in Ruby?
and is the same as && but with lower precedence.
44.Difference between method overloading and method overwriting
def: In Method Overloading, Methods of the same class shares the same name but each method must havedifferent number of parameters or parameters having different types and order.
Method Overloading means more than one method shares the same name in the class but having differentsignature. In Method Overloading, methods must have different signature.
Method Overloading does not require more than one class for overloading.
Def: In Method Overriding, sub class have the same method with same name and exactly the same numberand type of parameters and same return type as a super class.
Method Overriding means method of base class is re-defined in the derived class having same signature.
In Method Overriding, methods must have same signature.
Method Overriding requires at least two classes for overriding.
45.What is the Notation used for denoting class variables in Ruby?
We can know a variable as "Class variable’s" if its preceded by @@ symbols.
46.What is the use of Destructive Method?
Distructive methods are used to change the object value permanently by itself using bang (!) operator.
'sort' returns a new array and leaves the original unchanged.
'sort!' returns the same array with the modification.
The '!' indicates it’s a destructive method. It will overwrite the current array with the new result andreturns it.
47.What is the use of load and require in Ruby?
The require() method is quite similar to load(), but it’s meant for a different purpose.
You use load() to execute code, and you use require() to import libraries.
48.What is the use of Global Variable in Ruby?
Syntactically, a global variable is a variable whose name begins with $ Global variables in Ruby areaccessible from anywhere in the Ruby program, regardless of where they are declared.
$welcome = "Welcome to Ruby Essentials"
49.How does nil and false differ?
nil cannot be a value, where as a false can be a value A method returns true or false in case of a predicate,other wise nil is returned. false is a Boolean data type, where as nil is not. nil is an object for Nil Class,where as false is an object of for False Class
50.What is the difference between symbol and string?
Symbols have two nice properties compared to strings which can save you memory and CPU time Thedifference remains in the object_id, memory and process time for both of them when used together at onetime Strings are considered as mutable objects. Whereas, symbols, belongs to the category of immutable
Strings objects are mutable so that it takes only the assignments to change the object information. Whereas,information of, immutable objects gets overwritten
51.How to use super key word?
Ruby uses the super keyword to call the super class implementation of the current method. Within thebody of a method, calls to super acts just like a call to that original method. The search for a method bodystarts in the super class of the object that was found to contain the original method.
def url=(addr)
super (addr.blank? || addr.starts_with?('http')) ? addr : http://#{addr}
52.What are Float, Dig and Max?
Float class is used whenever the function changes constantly. It acts as a sub class of numeric. Theyrepresent real characters by making use of the native architecture of the double precision floating point.
Max is used whenever there is a huge need of Float.
Dig is used whenever you want to represent a float in decimal digits.
53.Difference between puts and print
puts adds a newline to the end of the output. print does not.
54.What are the servers supported by ruby on rails application?
Passenger running on Apache. Easy to set up, low memory usage, and well supported. nginx with puma(itis a multi-threaded high performance web server written in Ruby).
55.What is has_many?
It is a way of defining relationships among models. Correct, and Do you guys really know has_many isalso an example of Meta-programming? Wondering, How?
56.What is TDD and BDD?
Test-Driven-Development and Behavior-Driven-Development
57.What is the difference between '&&' and '||' operators?
"&&" has higher precedence than "||" like in most other mainstream languages; but "or" and "and" in rubyhave the same(!) precedence level!
so if you write
(func1 || func2 && func3), it’s (func1 || (func2 && func3))
but
(func1 or func2 and func3) is interpreted as ((func1 or func2) and func3)
because of shorcircuiting, if func1 is true, both func2 and func3 won't be called at all in the first example
but in the second example func3 WILL be called! this difference is subtile enough that I really do notrecommend newbie's to use "and" and "or" in ruby at all.
58.What is the Purpose of "!" and "?" at the end of method names?
It's "just sugarcoating" for readability, but they do have common meanings:
Methods ending in ! perform some permanent or potentially dangerous change; for example:
Enumerable#sort returns a sorted version of the object while Enumerable#sort! sorts it in place.
In Rails, ActiveRecord::Base#save returns false if saving failed, while ActiveRecord::Base#save! raises anexception.
Kernel::exit causes a script to exit, while Kernel::exit! does so immediately, bypassing any exit handlers.
Methods ending in ? return a boolean, which makes the code flow even more intuitively like a sentence —if number. zero? reads like "if the number is zero", but if number. zero just looks weird.
In your example, name. reverse evaluates to a reversed string, but only after the name. reverse! line doesthe name variable actually contain the reversed name. name.is_binary_data? looks like "is name binarydata?". Just remember it in simple In Ruby the ? means that the method is going to return a boolean andthe ! modifies the object it was called on. They are there to improve readability when looking at the code.
59.How can you list all routes for an application?
By writing rake routes in the terminal we can list out all routes in an application.
60.What is rake?
rake is command line utility of rails. "Rake is Ruby Make, a standalone Ruby utility that replaces the Unixutility 'make', and uses a 'Rakefile' and .rake files to build up a list of tasks. In Rails, Rake is used forcommon administration tasks, especially sophisticated ones that build off of each other." Putting in simpleword : "rake will execute different tasks(basically a set of ruby code) specified in any file with .rakeextension from comandline."
61.What are the differences between MongoDB and Redis?
Redis is a key value store while mongoDB is a document store.
1.Data model
MongoDB
Document oriented, JSON-like. Each document has unique key within a collection. Documents areheterogeneous. Redis
Key-value, values are:
Lists of strings
Sets of strings (collections of non-repeating unsorted elements)
Sorted sets of strings (collections of non-repeating elements ordered by a floating-point number calledscore) Hashes where keys are strings and values are either strings or integers After Wikipedia.
2.Storage
Monod
Disk, memory-mapped files, index should fit in RAM.
Reds
Typically in-memory.
3.Querying
By key, by any value in document (indexing possible), Map/Reduce.
By key.
62.What are the new features of Rails4?
1. Ruby Versions
2. ‘Gemfile’
3. ‘Threadsafe’ by Default
4. No More vendor/plugins
5. New Testing Directories
6. Strong Parameters
7. Renamed Callback
10. Queuing system
13. Cache Digests (Russian Dol Caching)
14. Turbo links
63.Explain what is Ruby on Rail?
64.Explain what is class libraries in Ruby?
Class libraries in Ruby consist of a variety of domains, such as data types, thread programming, variousdomains, etc.
65.Mention what is the naming convention in Rails?
66.Explain what is “Yield” in Ruby on Rail?
A Ruby method that receives a code block invokes it by calling it with the “Yield”.
67.Explain what is ORM (Object-Relationship-Model) in Rails?
ORM or Object Relationship Model in Rails indicate that your classes are mapped to the table in the database,and objects are directly mapped to the rows in the table.
68.Mention what the difference is between false and nil in Ruby?
In Ruby False indicates a Boolean data type, while Nil is not a data type, it have an object_id 4.
69.Mention what are the positive aspects of Rail?
Rail provides many features like
70.Explain what is the role of sub-directory app/controllers and app/helpers?
71.Mention what is the difference between String and Symbol?
They both act in the same way only they differ in their behaviors which are opposite to each other. Thedifference lies in the object_id, memory and process tune when they are used together. Symbol belongs tothe category of immutable objects whereas Strings are considered as mutable objects.
72.Explain how Symbol is different from variables?
Symbol is different from variables in following aspects
73.Explain what is Rails Active Record in Ruby on Rail?
Rails active record is the Object/Relational Mapping (ORM) layer supplied with rails. It follows thestandard ORM model as
74.Explain how rails implements Ajax?
Ajax powered web page retrieves the web page from the server which is new or changed unlike otherweb-page where you have to refresh the page to get the latest information.
Rail triggers an Ajax Operation in following ways
75.Mention how you can create a controller for subject?
To create a controller for subject you can use the following command
C:\ruby\library> ruby script/generate controller subject
76.Mention what is Rail Migration?
Rail Migration enables Ruby to make changes to the database schema, making it possible to use a versioncontrol system to leave things synchronized with the actual code.
77.List out what can Rail Migration do?
Rail Migration can do following things
78.Mention what is the command to create a migration?
To create migration command includes
C:\ruby\application>ruby script/generate migration table_name
79.Mention what is the command to create a migration?
80.Explain when self.up and self.down method is used?
When migrating to a new version, self.up method is used while self.down method is used to roll back mychanges if needed.
81.Mention what is the role of Rails Controller?
The Rail controller is the logical center of the application. It faciliates the interaction between the users,views, and the model. It also performs other activities like
It is capable of routing external requests to internal actions. It handles URL extremely well
It regulates helper modules, which extend the capabilities of the view templates without bulking of their code
It regulates sessions; that gives users the impression of an ongoing interaction with our applications
82.Mention what is the difference between Active support’s “HashWithIndifferent” and Ruby’s “Hash” ?
The Hash class in Ruby’s core library returns value by using a standard “= =” comparison on the keys. Itmeans that the value stored for a symbol key cannot be retrieved using the equivalent string. While theHashWithIndifferentAccess treats Symbol keys and String keys as equivalent.
83.Explain what is Cross-Site Request Forgery (CSRF) and how rails is protected against it?
CSRF is a form of attack where hacker submits a page request on your behalf to a different website,causing damage or revealing your sensitive data. To protect from CSRF attacks, you have to add“protect_from_forgery” to your ApplicationController. This will cause Rails to require a CSRF token toprocess the request. CSRF token is given as a hidden field in every form created using Rails form builders.
84.Explain what is Mixin in Rails?
Mixin in Ruby offers an alternative to multiple inheritances, using mixin modules can be imported insideother class.
85.Explain how you define Instance Variable, Global Variable and Class Variable in Ruby?
86.Explain how you can run Rails application without creating databases?
You can execute your application by uncommenting the line in environment.rb
path=> rootpath conf/environment.rb
config.frameworks = [ action_web_service, :action_mailer, :active_record]
87.Mention what is the difference between the Observers and Callbacks in Ruby on Rail?
88.Explain what is rake in Rail?
Rake is a Ruby Make; it is a Ruby utility that substitutes the Unix utility ‘make’, and uses a ‘Rakefile’ and‘.rake files’ to build up a list of tasks. In Rails, Rake is used for normal administration tasks like migratingthe database through scripts, loading a schema into the database, etc.
89.Explain how you can list all routes for an application?
To list out all routes for an application you can write rake routes in the terminal.
90.Explain what is sweeper in rails?
Sweepers are responsible for expiring or terminating caches when model object changes.
91.Mention the log that has to be seen to report errors in Ruby rails?
Rails will report errors from Apache in the log/Apache.log and errors from the Ruby code inlog/development.log.
92.Mention what is the function of garbage collection in Ruby on Rails?
The functions of garbage collection in Ruby on Rail includes
93.Explain what is the difference between Dynamic and Static Scaffolding?
Dynamic Scaffolding
Static Scaffolding
It automatically creates the entire
content and user interface at
runtime
It requires manual entry in the
command to create the data with
their fields
It enables to generation of new,
delete, edit methods for the use inApplication
It does not require any such
generation to take place
It does not need a database to be
synchronized
It requires the database to be
migrated
94.Mention what is the difference between redirect and render in Ruby on Rail?
95.Mention what is the purpose of RJs in Rails?
RJs is a template that produces JavaScript which is run in an eval block by the browser in response to anAJAX request. It is sometimes used to define the JavaScript, Prototype and helpers provided by Rails.
96.Explain what is Polymorphic Association in Ruby on Rail?
Polymorphic Association allows an Active Record object to be connected with Multiple Active Recordobjects. A perfect example of Polymorphic Association is a social site where users can comment onanywhere whether it is a videos, photos, link, status updates etc. It would be not feasible if you have tocreate an individual comment like photos_comments, videos_comment and so on.
97.Mention what are the limits of Ruby on Rail?
Ruby on Rail has been designed for creating a CRUD web application using MVC. This might make Railnot useful for other programmers. Some of the features that Rail does not support include
98.What is a module?
A module is like a class. Except that it can’t be instantiated or subclassed. In OOP paradigm you wouldstore methods & variables that represent variables in a single class. Say you want to create an Employeerepresentation then the employee’s name, age, salary, etc. would all go inside a Employee class, in a filecalled Employee.rb Any methods that act on those variables would also go inside that class. You canachieve the same effect by putting all the variables and methods inside a Employee module:
module Employee
..variables.
...methods
The main difference between the class & module is that a module cannot be instantiated or subclassed.
Module are better suited for library type classes such as Math library, etc.
99.What is agile development?
Agile methodology is anadaptaive methodology, its people oriented.
Agile methodology is on daily basis report. How much work we have completed on that day and howmuch work is still pending…it gives the clear picture but the req are not defined beforehand itselfcompletely.. req will be changing….
100.What is Ruby Gems?
101.What is passenger?
Easy and robust deployment of ruby on rails app on apache and ngix web servers passenger is anintermediate to run the ruby language in Linux server
102.What is request.xhr?
103.What is Session and Cookies?
104.What is asset pipeline?
asset pipeline which enables proper organization of CSS and JavaScript.
105.What is eager loading?
106.What is Active Record?
107.Ruby Supports Single Inheritance/Multiple Inheritance or Both?
108.How many types of callbacks available in ROR?
109.What is bundler?
Bundler is a new concept introduced in Rails3, which helps to you manage your gems for the application.After specifying gems in your Gemfile, you need to do a bundle install. If the gem is available in thesystem, bundle will use that else it will pick up from the rubygems.org.
110.What is the Notation used for denoting class variables in Ruby?
We can know a variable as “Class variable’s” if its preceded by @@ symbols.
111.What is the use of Destructive Method?
Destructive methods are used to change the object value permanently by itself using bang (!) operator.
‘sort’ returns a new array and leaves the original unchanged.
‘sort!’ returns the same array with the modification.
The ‘!’ indicates it’s a destructive method. It will overwrite the current array with the new result and
returns it.
112.What is the use of load and require in Ruby?
113.What is the use of Global Variable in Ruby?
Syntactically, a global variable is a variable whose name begins with $
Global variables in Ruby are accessible from anywhere in the Ruby program, regardless of where they
are declared.
$welcome = “Welcome to Ruby Essentials”
114.How does nil and false differ?
nil cannot be a value, where as a false can be a value
A method returns true or false in case of a predicate, other wise nil is returned.
false is a Boolean data type, where as nil is not.
nil is an object for NilClass, where as false is an object of for False Class
115.What is the difference between symbol and string?
116.How to use super key word?
Ruby uses the super keyword to call the superclass implementation of the current method. Within the bodyof a method, calls to super acts just like a call to that original method. The search for a method body startsin the superclass of the object that was found to contain the original method.
super (addr.blank? || addr.starts_with?(‘h?p’)) ? addr : h?p://# (h?p://#){addr}