<article>
<h1>タイトル</h1>
<div>
<p>本文</p>
</div>
</article>これを
| # 得意メソッド、クラスメソッド定義2連発、3連発 | |
| # class << C, class << a, def self.foo, def a.foo | |
| class C;end | |
| # (1) | |
| class << C | |
| def foo | |
| puts 'OK' | |
| end | |
| end | |
| class C |
| #内部DSLのソースコード | |
| class Module | |
| def attr_reader(*symbols) | |
| symbols.each do |symbol| | |
| class_eval %( | |
| def #{symbol} | |
| @#{symbol} | |
| end | |
| ) | |
| end |
| # クラスメソッド Enalbe_foo | |
| module Product | |
| def foo | |
| puts "OK2" | |
| end | |
| end | |
| class F | |
| include Product | |
| end |
| [ | |
| { | |
| "no": 1, | |
| "point_no": 1, | |
| "japanese": "この池は冬には凍る。", | |
| "english": "This pond freezes in the winter.", | |
| "note": "最も基本的な形。「∼は」にあたる this pond を主語に決めたら,述語動詞の freeze に3単現の -s が必要かどうかを考える。修飾語句の「冬には」は〈in the winter〉として文末に置く。この the はつけなくてもよい。" | |
| }, | |
| { | |
| "no": 2, |
| const f = (x) => { | |
| return ( | |
| x * x | |
| ) | |
| } | |
| const g = (x) => | |
| { | |
| return ( x | |
| * x | |
| ) |
| <!-- http://www.itdashboard.go.jp/DataFeeds/sampleGc --> | |
| <!-- jQueryのgetJSONでjsonを取って来て、jsonData変数へ格納 --> | |
| <!-- jsonData.raw_dataは配列でjsonData.raw_data[0], jsonData.raw_data[1]...って --> | |
| <!-- 感じでアクセスできる。 --> | |
| <!-- 入っている要素はjson。 --> | |
| <!-- こいつをgoogle.visualization.DataTable型のdataへ放り込めば良い! --><!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Sample Google Charts</title> |
| require 'active_record' | |
| require 'pp' | |
| ActiveRecord::Base.establish_connection( | |
| adapter: "sqlite3", | |
| database: "./yatoday.db" | |
| ) | |
| class Code < ActiveRecord::Base | |
| self.table_name = "Code2018_01_05" |