SlideShare a Scribd company logo
1 of 21
Ruby
Toshio Maki id:Kirika /   Kirika_K2
•          (@Kirika_K2)

•      id:Kirika / http://github.com/kirikak2/

•   SIer                           Ruby



•   Regional RubyKaigi
Ruby

•
•        Titanium Mobile
       jpmobile

• Ruby Silver/Gold
       Ruby
m(_ _)m
require ‘singleton’

class SingletonClass
  include Singleton
end


>> SingletonClass.new
NoMethodError: private method `new' called for SingletonClass:Class

>>SingletonClass.instance
=> #<SingletonClass:0x1005f7a98>
Rubygems
ActiveRecord::Singleton
Time   DateTime
Time
  • Time          Unix Time



Time.now + 30 * 365 * 24 * 3600 # 30
RangeError: time + 946080000.000000 out of Time range

         Ubuntu Linux(32bit)    NG           MacOS 10(64bit)   OK
    Windows

Time.now + 30 * 365 * 24 * 3600
=> Mon Oct 21 11:34:29 +0900 2041
DateTime
  •    DateTime               Rational            Time



  •               Rational
       1                 1                 1
       Rational(1,24)                             OK

require ‘date’

>> (DateTime.now - 365 * 12000).to_s # 1   2000
=> "-9980-01-02T11:46:35+09:00"
kconv UTF-8                         EUC
        UTF-8

    •     JIS                                 (Ruby 1.8.7            )

    •                           https://gist.github.com/1273188
require ‘kconv’

kanji5020_503F = <<KANJI



KANJI

p kanji5020_503F
p kanji5020_503F.toeuc.toutf8


"                                     n                                 n"
"С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Яnа б в г д е ж з и й к л м н о пn"
Ruby
2011.12. 24
Ruby overview and key concepts
Ruby overview and key concepts

More Related Content

What's hot

Mysql5.1 character set testing
Mysql5.1 character set testingMysql5.1 character set testing
Mysql5.1 character set testingPhilip Zhong
 
JSON's big problem android_taipei_201709
JSON's big problem android_taipei_201709JSON's big problem android_taipei_201709
JSON's big problem android_taipei_201709PRADA Hsiung
 
Mysql handle socket
Mysql handle socketMysql handle socket
Mysql handle socketPhilip Zhong
 
Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8Philip Zhong
 
Test for 'Libre Office' format support
Test for 'Libre Office' format supportTest for 'Libre Office' format support
Test for 'Libre Office' format supportViktorShepel
 
NS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesTeerawat Issariyakul
 

What's hot (10)

Ns tutorial
Ns tutorialNs tutorial
Ns tutorial
 
The State of JavaScript
The State of JavaScriptThe State of JavaScript
The State of JavaScript
 
ملخص البرمجة المرئية - الوحدة الثالثة
ملخص البرمجة المرئية - الوحدة الثالثةملخص البرمجة المرئية - الوحدة الثالثة
ملخص البرمجة المرئية - الوحدة الثالثة
 
Mysql5.1 character set testing
Mysql5.1 character set testingMysql5.1 character set testing
Mysql5.1 character set testing
 
JSON's big problem android_taipei_201709
JSON's big problem android_taipei_201709JSON's big problem android_taipei_201709
JSON's big problem android_taipei_201709
 
Mysql handle socket
Mysql handle socketMysql handle socket
Mysql handle socket
 
Bitcoin:Next
Bitcoin:NextBitcoin:Next
Bitcoin:Next
 
Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8
 
Test for 'Libre Office' format support
Test for 'Libre Office' format supportTest for 'Libre Office' format support
Test for 'Libre Office' format support
 
NS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variables
 

Similar to Ruby overview and key concepts

The Node.js Event Loop: Not So Single Threaded
The Node.js Event Loop: Not So Single ThreadedThe Node.js Event Loop: Not So Single Threaded
The Node.js Event Loop: Not So Single ThreadedBryan Hughes
 
Cocos2dを使ったゲーム作成の事例
Cocos2dを使ったゲーム作成の事例Cocos2dを使ったゲーム作成の事例
Cocos2dを使ったゲーム作成の事例Yuichi Higuchi
 
証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議Hiroki Mizuno
 
GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話
GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話
GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話なおき きしだ
 
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Hiroki Mizuno
 
はじめてのUnitTest XCTestに触れて
はじめてのUnitTest XCTestに触れてはじめてのUnitTest XCTestに触れて
はじめてのUnitTest XCTestに触れてKenji Tanaka
 
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみたスマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみたTaro Matsuzawa
 

Similar to Ruby overview and key concepts (7)

The Node.js Event Loop: Not So Single Threaded
The Node.js Event Loop: Not So Single ThreadedThe Node.js Event Loop: Not So Single Threaded
The Node.js Event Loop: Not So Single Threaded
 
Cocos2dを使ったゲーム作成の事例
Cocos2dを使ったゲーム作成の事例Cocos2dを使ったゲーム作成の事例
Cocos2dを使ったゲーム作成の事例
 
証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議
 
GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話
GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話
GraalVMの紹介とTruffleでPHPぽい言語を実装したら爆速だった話
 
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
 
はじめてのUnitTest XCTestに触れて
はじめてのUnitTest XCTestに触れてはじめてのUnitTest XCTestに触れて
はじめてのUnitTest XCTestに触れて
 
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみたスマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
 

More from Maki Toshio

Rails 6.1 → 7.0アップデート記録
Rails 6.1 → 7.0アップデート記録Rails 6.1 → 7.0アップデート記録
Rails 6.1 → 7.0アップデート記録Maki Toshio
 
自社サービスのAPIをOAuth2対応にして公開した
自社サービスのAPIをOAuth2対応にして公開した自社サービスのAPIをOAuth2対応にして公開した
自社サービスのAPIをOAuth2対応にして公開したMaki Toshio
 
Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6Maki Toshio
 
ActiveRecordで複雑なクエリを書くのは間違っているのか
ActiveRecordで複雑なクエリを書くのは間違っているのかActiveRecordで複雑なクエリを書くのは間違っているのか
ActiveRecordで複雑なクエリを書くのは間違っているのかMaki Toshio
 
やさしいGemパッチの作り方
やさしいGemパッチの作り方やさしいGemパッチの作り方
やさしいGemパッチの作り方Maki Toshio
 
ファイルシステムのスナップショット機能でバックアップを取得する
ファイルシステムのスナップショット機能でバックアップを取得するファイルシステムのスナップショット機能でバックアップを取得する
ファイルシステムのスナップショット機能でバックアップを取得するMaki Toshio
 
Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy
Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the ProxyCloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy
Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the ProxyMaki Toshio
 
メール製品を作って気づいたmailライブラリの光と闇について語る
メール製品を作って気づいたmailライブラリの光と闇について語るメール製品を作って気づいたmailライブラリの光と闇について語る
メール製品を作って気づいたmailライブラリの光と闇について語るMaki Toshio
 
Rubyで簡単にremote access apiを実行する
Rubyで簡単にremote access apiを実行するRubyで簡単にremote access apiを実行する
Rubyで簡単にremote access apiを実行するMaki Toshio
 
レガシーコード改善ガイド
レガシーコード改善ガイドレガシーコード改善ガイド
レガシーコード改善ガイドMaki Toshio
 
Ruby on rails on hudsonの活用事例
Ruby on rails on hudsonの活用事例Ruby on rails on hudsonの活用事例
Ruby on rails on hudsonの活用事例Maki Toshio
 

More from Maki Toshio (11)

Rails 6.1 → 7.0アップデート記録
Rails 6.1 → 7.0アップデート記録Rails 6.1 → 7.0アップデート記録
Rails 6.1 → 7.0アップデート記録
 
自社サービスのAPIをOAuth2対応にして公開した
自社サービスのAPIをOAuth2対応にして公開した自社サービスのAPIをOAuth2対応にして公開した
自社サービスのAPIをOAuth2対応にして公開した
 
Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6
 
ActiveRecordで複雑なクエリを書くのは間違っているのか
ActiveRecordで複雑なクエリを書くのは間違っているのかActiveRecordで複雑なクエリを書くのは間違っているのか
ActiveRecordで複雑なクエリを書くのは間違っているのか
 
やさしいGemパッチの作り方
やさしいGemパッチの作り方やさしいGemパッチの作り方
やさしいGemパッチの作り方
 
ファイルシステムのスナップショット機能でバックアップを取得する
ファイルシステムのスナップショット機能でバックアップを取得するファイルシステムのスナップショット機能でバックアップを取得する
ファイルシステムのスナップショット機能でバックアップを取得する
 
Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy
Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the ProxyCloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy
Cloud Foundry Day in Tokyo Lightning Talk - Cloud Foundry over the Proxy
 
メール製品を作って気づいたmailライブラリの光と闇について語る
メール製品を作って気づいたmailライブラリの光と闇について語るメール製品を作って気づいたmailライブラリの光と闇について語る
メール製品を作って気づいたmailライブラリの光と闇について語る
 
Rubyで簡単にremote access apiを実行する
Rubyで簡単にremote access apiを実行するRubyで簡単にremote access apiを実行する
Rubyで簡単にremote access apiを実行する
 
レガシーコード改善ガイド
レガシーコード改善ガイドレガシーコード改善ガイド
レガシーコード改善ガイド
 
Ruby on rails on hudsonの活用事例
Ruby on rails on hudsonの活用事例Ruby on rails on hudsonの活用事例
Ruby on rails on hudsonの活用事例
 

Recently uploaded

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Recently uploaded (20)

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Ruby overview and key concepts

  • 2. (@Kirika_K2) • id:Kirika / http://github.com/kirikak2/ • SIer Ruby • Regional RubyKaigi
  • 3.
  • 4. Ruby • • Titanium Mobile jpmobile • Ruby Silver/Gold Ruby
  • 5.
  • 7.
  • 8.
  • 9. require ‘singleton’ class SingletonClass include Singleton end >> SingletonClass.new NoMethodError: private method `new' called for SingletonClass:Class >>SingletonClass.instance => #<SingletonClass:0x1005f7a98>
  • 10.
  • 12.
  • 13. Time DateTime
  • 14. Time • Time Unix Time Time.now + 30 * 365 * 24 * 3600 # 30 RangeError: time + 946080000.000000 out of Time range Ubuntu Linux(32bit) NG MacOS 10(64bit) OK Windows Time.now + 30 * 365 * 24 * 3600 => Mon Oct 21 11:34:29 +0900 2041
  • 15. DateTime • DateTime Rational Time • Rational 1 1 1 Rational(1,24) OK require ‘date’ >> (DateTime.now - 365 * 12000).to_s # 1 2000 => "-9980-01-02T11:46:35+09:00"
  • 16.
  • 17. kconv UTF-8 EUC UTF-8 • JIS (Ruby 1.8.7 ) • https://gist.github.com/1273188 require ‘kconv’ kanji5020_503F = <<KANJI KANJI p kanji5020_503F p kanji5020_503F.toeuc.toutf8 " n n" "С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Яnа б в г д е ж з и й к л м н о пn"
  • 18. Ruby

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n