Eigenclass methods is accessible by class <<. It is a class containing the singleton methods, and class methods.
First example: define a singleton method for an instance.
class Foo; end
foo = Foo.new
class << foo
Second example: define a singleton method for a class. Actually class Foo is an instance of class Class. And foo is an instance of class Foo
There are 4 ways to create a class method:
Use Class Open technique inside a class definition class << self
Use Class Open technique outside of class definition class << Foo
def shout; end
def self.whistle; end
class << self
def sing; end
class << Foo
def speak; end
def talk; end
# [:speak, :talk, :sing]
And there are 2 ways to create an instance methods
def fly; end
def soar; end
# [:fly, :soar]
JQuery Fundamentals: after realizing that I don’t know the syntax of jquery well enough, I decided to self-educate myself on that matter. And I made a decision to start by reading a book, to at least have the basic knowledge.
B. Something new
Using the localization in jquery-ui-datepicker
And in order to use a datepicker, we need to include all the languages that we’re going to use.
spreewald: from makandra, predefine most frequently used cucumber steps.
consul: from makandra again, to restrict the access right to data.
&& vs. andin ruby
use && for the task when you need only the boolean output. && has high precedence.
The and usage is more complicated, in a sense that it connects two parts of the evaluation. Use and in control flow. and has low precedence.
Ruby: false, nil
C. Something to remember
To deploy the code, vagrant ssh, and then bundle exec cap playground deploy. Since we need the ssh private key, and we can only have access to that key while we are still inside the local environment. Deploying from the terminal in vagrant would not work.