Git: find submodule

git ls-files --stage | grep 160000

2015-05-13 10:2915Git

Metaprogramming: ORM

元编程:对象关系映射(Object-relational mapping)

Ruby code:

require 'sqlite3'

Database = SQLite3::Database.new ':memory:'

class Entity

def initialize(table, ident)

@table = table

@ident = ident

Database.execute "CREATE TABL......

Metaprogramming: Introspection

元编程:内省(xǐng)

Ruby code:

class Greeting

def initialize text

@text = text

end

def welcome

@text

end

end

my_object = Greeting.new "Hello"

puts my_object.welcome

puts

puts my_object.class

puts

puts my_object.class.instance_m......