This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "hello world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "Hello World" | |
class AccessControllTester | |
def private_method | |
puts 'private_method' | |
end | |
def protected_method | |
puts 'protected_method' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass | |
private | |
def say_hello(name) | |
puts "Hello, #{name}." | |
end | |
end | |
my_object = MyClass.new | |
my_object.send :say_hello, "world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
def initialize(*args) | |
puts "Initializing Foo" | |
end | |
end | |
=> nil | |
def Foo(*args, &block) | |
puts args.inspect | |
block.call if block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def Foo(*args, &block) | |
puts args.inspect | |
block.call if block | |
Class.new(Foo) | |
end | |
=> nil | |
class Bar < Foo("Hi There!") { | |
puts "Surprise!" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string.gsub(/(<%[^(<%|%>)]+%>)/) { |s| eval(s[2..-3]) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
def hello | |
self.world | |
end | |
private | |
def world | |
puts "world" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rails | |
class Initializer | |
# Sequentially step through all of the available initialization routines, | |
# in order (view execution order in source). | |
def process | |
Rails.configuration = configuration | |
check_ruby_version | |
install_gem_spec_stubs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first way: straightforward, also need to add generators engine | |
gem 'refinerycms', '~> 2.0.0', :git => 'git://github.com/resolve/refinerycms.git' | |
gem 'refinerycms-generators', :git => 'git://github.com/resolve/refinerycms-generators.git' | |
# second way: optional | |
gem 'devise' #temporarily commented out,'~> 1.4.0' | |
gem 'refinerycms-base', :git => 'git://github.com/resolve/refinerycms.git' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define the base class | |
class Car | |
{ | |
public virtual void DescribeCar() | |
{ | |
System.Console.WriteLine("Four wheels and an engine."); | |
} | |
} | |
// Define the derived classes |
OlderNewer