This document discusses programming languages PHP and Ruby. It mentions Ruby multiple times and references Wikipedia as well as programming concepts like if statements, return, and rescue which are found in Ruby. The document also contains the words "Book" and "Note" but is otherwise difficult to understand at a glance due to the formatting.
This document outlines the installation of multiple Ruby versions and their associated Devkit packages on Windows. It describes downloading Ruby 1.8.7, 2.0.0, and 2.3.0 installers as well as Devkit packages for 32-bit and 64-bit. It provides instructions to initialize and install the Devkits to support compiling native extensions. Finally, it explains how to initialize a Ruby on Rails project using Bundler to manage gem dependencies.
50. クラスアノテーション導入による
リファクタリング
module CustomInitializers
def hash_initializer(*attribute_names)
define_method(:initialize) do |*args|
data = args.first || {}
attribute_names.each do |attribute_name|
instance_variable_set
"@#{attribute_name}", data[attribute_name]
end
end
endm
end
Class.send :include, CustomInitializers
class SearchCriteria...
hash_initializer :author_id, :publichsr_id, :isbn
end
51. クラスメソッド
class MyClass
def self.my_method;
:
end
end
def MyClass.my_other_method
:
end