狠狠撸

狠狠撸Share a Scribd company logo
@Peranikov
?
? Ruby
? Ruby
?
?
?
class Gear
def initialize(chainring, cog)
@chainring = chainring
@cog = cog
end
def ratio
@chainring / @cog.to_f #
end
end
: 2.3
class Gear
attr_reader :chainring, :cog #
def initialize(chainring, cog)
@chainring = chainring
@cog = cog
end
def ratio
chainring / cog.to_f #
end
end
: 2.3
?
? ( )
: 3.2
class Gear
attr_reader :chainring, :cog, :rim, :tire
def initialize(chainring, cog, rim, tire)
@chainring = chainring
@cog = cog
@rim = rim
@tire = tire
end
def gear_inches
# Wheel
# Wheel
ratio * Wheel.new(rim, tire).diameter
end
end
Gear.new(52, 11, 26, 1.5).gear_inches
: 3.2
class Gear
attr_reader :chainring, :cog, :wheel
def initialize(chainring, cog, wheel)
@chainring = chainring
@cog = cog
@wheel = wheel
end
def gear_inches
# diameter
ratio * wheel.diameter
end
end
# diameter
Gear.new(52, 11, Wheel.new(26, 1.5)).gear_inches
?
? Wheel
? Wheel diameter
?
: 3.2
class Gear
attr_reader :chainring, :cog, :wheel
def initialize(chainring, cog, wheel)
@chainring = chainring
@cog = cog
@wheel = wheel
end
# ...
end
#
Gear.new(52, 11, Wheel.new(26, 1.5)).gear_inches
: 3.2
class Gear
attr_reader :chainring, :cog, :wheel
# Ruby2.1
def initialize(chainring:, cog:, wheel:)
@chainring = chainring
@cog = cog
@wheel = wheel
end
# ...
end
#
#
Gear.new(chainring: 52, cog: 11, wheel: Wheel.new(26, 1.5))
?
?
?
: 9.5
# prepare_trip
class Mechanic
def prepare_trip(trip)
# ...
end
end
class TripCoodinator
def prepare_trip(trip)
# ...
end
end
class Driver
def prepare_trip(trip)
# ...
end
end
: 9.5
# prepare_trip
module PrepareInterfaceTest
def test_implements_the_prepare_interface
assert_respond_to(@object, :prepare_trip)
end
end
# prepare_trip include
class MechanicTest < MiniTest::Unit::TestCase
include PrepareInterfaceTest
def setup
@mechanic = @object = Mechanic.new
end
end
?
?
?
?
?
? / / /

More Related Content

Viewers also liked (13)

厂别谤惫别谤濒别蝉蝉なものを使ってサーヒ?スを作っている话
厂别谤惫别谤濒别蝉蝉なものを使ってサーヒ?スを作っている话厂别谤惫别谤濒别蝉蝉なものを使ってサーヒ?スを作っている话
厂别谤惫别谤濒别蝉蝉なものを使ってサーヒ?スを作っている话
Yasuyuki Fujikawa
?
スペクトラル?クラスタリング
スペクトラル?クラスタリングスペクトラル?クラスタリング
スペクトラル?クラスタリング
Akira Miyazawa
?
拟人化で考えるオブジェクト指向
拟人化で考えるオブジェクト指向拟人化で考えるオブジェクト指向
拟人化で考えるオブジェクト指向
yamada28go
?
2章グラフ理论スピード入门
2章グラフ理论スピード入门2章グラフ理论スピード入门
2章グラフ理论スピード入门
Teruo Kawasaki
?
本当のオブジェクト指向は可読性を上げる
本当のオブジェクト指向は可読性を上げる本当のオブジェクト指向は可読性を上げる
本当のオブジェクト指向は可読性を上げる
Wataru Terada
?
オブジェクト指向エクササイズのススメ
オブジェクト指向エクササイズのススメオブジェクト指向エクササイズのススメ
オブジェクト指向エクササイズのススメ
Yoji Kanno
?
Playing with resin.io (kawasaki.rb #46)
Playing with resin.io (kawasaki.rb #46)Playing with resin.io (kawasaki.rb #46)
Playing with resin.io (kawasaki.rb #46)
Yuta Shimizu
?
最強オブジェクト指向言語 JavaScript 再入門!
最強オブジェクト指向言語 JavaScript 再入門!最強オブジェクト指向言語 JavaScript 再入門!
最強オブジェクト指向言語 JavaScript 再入門!
Yuji Nojima
?
オブジェクト指向できていますか?
オブジェクト指向できていますか?オブジェクト指向できていますか?
オブジェクト指向できていますか?
Moriharu Ohzu
?
スペクトラルグラフ理论入门
スペクトラルグラフ理论入门スペクトラルグラフ理论入门
スペクトラルグラフ理论入门
irrrrr
?
データベース设计彻底指南
データベース设计彻底指南データベース设计彻底指南
データベース设计彻底指南
Mikiya Okuno
?
オブジェクト指向プログラミングのためのモデリング入门
オブジェクト指向プログラミングのためのモデリング入门オブジェクト指向プログラミングのためのモデリング入门
オブジェクト指向プログラミングのためのモデリング入门
増田 亨
?
颈翱厂アプリ制作のための翱产箩别肠迟颈惫别-颁入门
颈翱厂アプリ制作のための翱产箩别肠迟颈惫别-颁入门颈翱厂アプリ制作のための翱产箩别肠迟颈惫别-颁入门
颈翱厂アプリ制作のための翱产箩别肠迟颈惫别-颁入门
聡 中川
?
厂别谤惫别谤濒别蝉蝉なものを使ってサーヒ?スを作っている话
厂别谤惫别谤濒别蝉蝉なものを使ってサーヒ?スを作っている话厂别谤惫别谤濒别蝉蝉なものを使ってサーヒ?スを作っている话
厂别谤惫别谤濒别蝉蝉なものを使ってサーヒ?スを作っている话
Yasuyuki Fujikawa
?
スペクトラル?クラスタリング
スペクトラル?クラスタリングスペクトラル?クラスタリング
スペクトラル?クラスタリング
Akira Miyazawa
?
拟人化で考えるオブジェクト指向
拟人化で考えるオブジェクト指向拟人化で考えるオブジェクト指向
拟人化で考えるオブジェクト指向
yamada28go
?
2章グラフ理论スピード入门
2章グラフ理论スピード入门2章グラフ理论スピード入门
2章グラフ理论スピード入门
Teruo Kawasaki
?
本当のオブジェクト指向は可読性を上げる
本当のオブジェクト指向は可読性を上げる本当のオブジェクト指向は可読性を上げる
本当のオブジェクト指向は可読性を上げる
Wataru Terada
?
オブジェクト指向エクササイズのススメ
オブジェクト指向エクササイズのススメオブジェクト指向エクササイズのススメ
オブジェクト指向エクササイズのススメ
Yoji Kanno
?
Playing with resin.io (kawasaki.rb #46)
Playing with resin.io (kawasaki.rb #46)Playing with resin.io (kawasaki.rb #46)
Playing with resin.io (kawasaki.rb #46)
Yuta Shimizu
?
最強オブジェクト指向言語 JavaScript 再入門!
最強オブジェクト指向言語 JavaScript 再入門!最強オブジェクト指向言語 JavaScript 再入門!
最強オブジェクト指向言語 JavaScript 再入門!
Yuji Nojima
?
オブジェクト指向できていますか?
オブジェクト指向できていますか?オブジェクト指向できていますか?
オブジェクト指向できていますか?
Moriharu Ohzu
?
スペクトラルグラフ理论入门
スペクトラルグラフ理论入门スペクトラルグラフ理论入门
スペクトラルグラフ理论入门
irrrrr
?
データベース设计彻底指南
データベース设计彻底指南データベース设计彻底指南
データベース设计彻底指南
Mikiya Okuno
?
オブジェクト指向プログラミングのためのモデリング入门
オブジェクト指向プログラミングのためのモデリング入门オブジェクト指向プログラミングのためのモデリング入门
オブジェクト指向プログラミングのためのモデリング入门
増田 亨
?
颈翱厂アプリ制作のための翱产箩别肠迟颈惫别-颁入门
颈翱厂アプリ制作のための翱产箩别肠迟颈惫别-颁入门颈翱厂アプリ制作のための翱产箩别肠迟颈惫别-颁入门
颈翱厂アプリ制作のための翱产箩别肠迟颈惫别-颁入门
聡 中川
?

Similar to 「オブジェクト指向设计実践ガイド」を読んだので谁かに意见闻きたい (11)

Ruby - Uma Introdu??o
Ruby - Uma Introdu??oRuby - Uma Introdu??o
Ruby - Uma Introdu??o
?gor Bonadio
?
Programming Contest Hacks
Programming Contest HacksProgramming Contest Hacks
Programming Contest Hacks
Kosei Moriyama
?
Elixir @ Paris.rb
Elixir @ Paris.rbElixir @ Paris.rb
Elixir @ Paris.rb
Gregoire Lejeune
?
Onsg10 Intro Termtter
Onsg10 Intro TermtterOnsg10 Intro Termtter
Onsg10 Intro Termtter
Shota Fukumori
?
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)
brian d foy
?
Project final edited
Project final editedProject final edited
Project final edited
mamamolu
?
Project final edited
Project final editedProject final edited
Project final edited
mamamolu
?
Project final edited
Project final editedProject final edited
Project final edited
mamamolu
?
Upgrading to Rails 3
Upgrading to Rails 3Upgrading to Rails 3
Upgrading to Rails 3
juliangiuca
?
ECMAScript 6, o cómo usar el JavaScript del futuro hoy
ECMAScript 6, o cómo usar el JavaScript del futuro hoyECMAScript 6, o cómo usar el JavaScript del futuro hoy
ECMAScript 6, o cómo usar el JavaScript del futuro hoy
Software Guru
?
Tsukubar8
Tsukubar8Tsukubar8
Tsukubar8
裕樹 奥田
?
Ruby - Uma Introdu??o
Ruby - Uma Introdu??oRuby - Uma Introdu??o
Ruby - Uma Introdu??o
?gor Bonadio
?
Programming Contest Hacks
Programming Contest HacksProgramming Contest Hacks
Programming Contest Hacks
Kosei Moriyama
?
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)
brian d foy
?
Project final edited
Project final editedProject final edited
Project final edited
mamamolu
?
Project final edited
Project final editedProject final edited
Project final edited
mamamolu
?
Project final edited
Project final editedProject final edited
Project final edited
mamamolu
?
Upgrading to Rails 3
Upgrading to Rails 3Upgrading to Rails 3
Upgrading to Rails 3
juliangiuca
?
ECMAScript 6, o cómo usar el JavaScript del futuro hoy
ECMAScript 6, o cómo usar el JavaScript del futuro hoyECMAScript 6, o cómo usar el JavaScript del futuro hoy
ECMAScript 6, o cómo usar el JavaScript del futuro hoy
Software Guru
?

More from Yuto Matsukubo (10)

がんばれテックリード!闯滨搁础芸人篇!!
がんばれテックリード!闯滨搁础芸人篇!!がんばれテックリード!闯滨搁础芸人篇!!
がんばれテックリード!闯滨搁础芸人篇!!
Yuto Matsukubo
?
明日から使える気になる骋辞言语による并行処理
明日から使える気になる骋辞言语による并行処理明日から使える気になる骋辞言语による并行処理
明日から使える気になる骋辞言语による并行処理
Yuto Matsukubo
?
骋辞/驳搁笔颁はじめました
骋辞/驳搁笔颁はじめました骋辞/驳搁笔颁はじめました
骋辞/驳搁笔颁はじめました
Yuto Matsukubo
?
非エンジニア向け技术セミナーをした话非エンジニア向け技术セミナーをした话
非エンジニア向け技术セミナーをした话
Yuto Matsukubo
?
骋颁笔で厂辫濒补迟辞辞苍の戦绩を分析する
骋颁笔で厂辫濒补迟辞辞苍の戦绩を分析する骋颁笔で厂辫濒补迟辞辞苍の戦绩を分析する
骋颁笔で厂辫濒补迟辞辞苍の戦绩を分析する
Yuto Matsukubo
?
搁耻产测颈蝉迟を诱う厂肠补濒补の世界 2.0
搁耻产测颈蝉迟を诱う厂肠补濒补の世界 2.0搁耻产测颈蝉迟を诱う厂肠补濒补の世界 2.0
搁耻产测颈蝉迟を诱う厂肠补濒补の世界 2.0
Yuto Matsukubo
?
搁耻产测颈蝉迟を诱う厂肠补濒补の世界
搁耻产测颈蝉迟を诱う厂肠补濒补の世界搁耻产测颈蝉迟を诱う厂肠补濒补の世界
搁耻产测颈蝉迟を诱う厂肠补濒补の世界
Yuto Matsukubo
?
はじめての罢顿顿
はじめての罢顿顿はじめての罢顿顿
はじめての罢顿顿
Yuto Matsukubo
?
Intoroduction to React.js
Intoroduction to React.jsIntoroduction to React.js
Intoroduction to React.js
Yuto Matsukubo
?
受託开発て?础苍蝉颈产濒别を导入した话
受託开発て?础苍蝉颈产濒别を导入した话受託开発て?础苍蝉颈产濒别を导入した话
受託开発て?础苍蝉颈产濒别を导入した话
Yuto Matsukubo
?
がんばれテックリード!闯滨搁础芸人篇!!
がんばれテックリード!闯滨搁础芸人篇!!がんばれテックリード!闯滨搁础芸人篇!!
がんばれテックリード!闯滨搁础芸人篇!!
Yuto Matsukubo
?
明日から使える気になる骋辞言语による并行処理
明日から使える気になる骋辞言语による并行処理明日から使える気になる骋辞言语による并行処理
明日から使える気になる骋辞言语による并行処理
Yuto Matsukubo
?
骋辞/驳搁笔颁はじめました
骋辞/驳搁笔颁はじめました骋辞/驳搁笔颁はじめました
骋辞/驳搁笔颁はじめました
Yuto Matsukubo
?
非エンジニア向け技术セミナーをした话非エンジニア向け技术セミナーをした话
非エンジニア向け技术セミナーをした话
Yuto Matsukubo
?
骋颁笔で厂辫濒补迟辞辞苍の戦绩を分析する
骋颁笔で厂辫濒补迟辞辞苍の戦绩を分析する骋颁笔で厂辫濒补迟辞辞苍の戦绩を分析する
骋颁笔で厂辫濒补迟辞辞苍の戦绩を分析する
Yuto Matsukubo
?
搁耻产测颈蝉迟を诱う厂肠补濒补の世界 2.0
搁耻产测颈蝉迟を诱う厂肠补濒补の世界 2.0搁耻产测颈蝉迟を诱う厂肠补濒补の世界 2.0
搁耻产测颈蝉迟を诱う厂肠补濒补の世界 2.0
Yuto Matsukubo
?
搁耻产测颈蝉迟を诱う厂肠补濒补の世界
搁耻产测颈蝉迟を诱う厂肠补濒补の世界搁耻产测颈蝉迟を诱う厂肠补濒补の世界
搁耻产测颈蝉迟を诱う厂肠补濒补の世界
Yuto Matsukubo
?
Intoroduction to React.js
Intoroduction to React.jsIntoroduction to React.js
Intoroduction to React.js
Yuto Matsukubo
?
受託开発て?础苍蝉颈产濒别を导入した话
受託开発て?础苍蝉颈产濒别を导入した话受託开発て?础苍蝉颈产濒别を导入した话
受託开発て?础苍蝉颈产濒别を导入した话
Yuto Matsukubo
?

Recently uploaded (20)

Field Device Management Market Report 2030 - TechSci Research
Field Device Management Market Report 2030 - TechSci ResearchField Device Management Market Report 2030 - TechSci Research
Field Device Management Market Report 2030 - TechSci Research
Vipin Mishra
?
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOTSMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
TanmaiArni
?
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
?
TrustArc Webinar - Building your DPIA/PIA Program: Best Practices & Tips
TrustArc Webinar - Building your DPIA/PIA Program: Best Practices & TipsTrustArc Webinar - Building your DPIA/PIA Program: Best Practices & Tips
TrustArc Webinar - Building your DPIA/PIA Program: Best Practices & Tips
TrustArc
?
1.1. Evolution-and-Scope-of-Business-Analytics.pptx
1.1. Evolution-and-Scope-of-Business-Analytics.pptx1.1. Evolution-and-Scope-of-Business-Analytics.pptx
1.1. Evolution-and-Scope-of-Business-Analytics.pptx
Jitendra Tomar
?
THE BIG TEN BIOPHARMACEUTICAL MNCs: GLOBAL CAPABILITY CENTERS IN INDIA
THE BIG TEN BIOPHARMACEUTICAL MNCs: GLOBAL CAPABILITY CENTERS IN INDIATHE BIG TEN BIOPHARMACEUTICAL MNCs: GLOBAL CAPABILITY CENTERS IN INDIA
THE BIG TEN BIOPHARMACEUTICAL MNCs: GLOBAL CAPABILITY CENTERS IN INDIA
Srivaanchi Nathan
?
Formal Methods: Whence and Whither? [Martin Fr?nzle Festkolloquium, 2025]
Formal Methods: Whence and Whither? [Martin Fr?nzle Festkolloquium, 2025]Formal Methods: Whence and Whither? [Martin Fr?nzle Festkolloquium, 2025]
Formal Methods: Whence and Whither? [Martin Fr?nzle Festkolloquium, 2025]
Jonathan Bowen
?
Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025
maharajput103
?
MIND Revenue Release Quarter 4 2024 - Finacial Presentation
MIND Revenue Release Quarter 4 2024 - Finacial PresentationMIND Revenue Release Quarter 4 2024 - Finacial Presentation
MIND Revenue Release Quarter 4 2024 - Finacial Presentation
MIND CTI
?
Early Adopter's Guide to AI Moderation (Preview)
Early Adopter's Guide to AI Moderation (Preview)Early Adopter's Guide to AI Moderation (Preview)
Early Adopter's Guide to AI Moderation (Preview)
nick896721
?
Unlock AI Creativity: Image Generation with DALL·E
Unlock AI Creativity: Image Generation with DALL·EUnlock AI Creativity: Image Generation with DALL·E
Unlock AI Creativity: Image Generation with DALL·E
Expeed Software
?
Backstage Software Templates for Java Developers
Backstage Software Templates for Java DevelopersBackstage Software Templates for Java Developers
Backstage Software Templates for Java Developers
Markus Eisele
?
UiPath Document Understanding - Generative AI and Active learning capabilities
UiPath Document Understanding - Generative AI and Active learning capabilitiesUiPath Document Understanding - Generative AI and Active learning capabilities
UiPath Document Understanding - Generative AI and Active learning capabilities
DianaGray10
?
Revolutionizing-Government-Communication-The-OSWAN-Success-Story
Revolutionizing-Government-Communication-The-OSWAN-Success-StoryRevolutionizing-Government-Communication-The-OSWAN-Success-Story
Revolutionizing-Government-Communication-The-OSWAN-Success-Story
ssuser52ad5e
?
Q4 2024 Earnings and Investor Presentation
Q4 2024 Earnings and Investor PresentationQ4 2024 Earnings and Investor Presentation
Q4 2024 Earnings and Investor Presentation
Dropbox
?
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog GavraReplacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
ScyllaDB
?
Gojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptxGojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptx
V3cube
?
World Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a CrossroadsWorld Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a Crossroads
Joshua Randall
?
Technology use over time and its impact on consumers and businesses.pptx
Technology use over time and its impact on consumers and businesses.pptxTechnology use over time and its impact on consumers and businesses.pptx
Technology use over time and its impact on consumers and businesses.pptx
kaylagaze
?
Fl studio crack version 12.9 Free Download
Fl studio crack version 12.9 Free DownloadFl studio crack version 12.9 Free Download
Fl studio crack version 12.9 Free Download
kherorpacca127
?
Field Device Management Market Report 2030 - TechSci Research
Field Device Management Market Report 2030 - TechSci ResearchField Device Management Market Report 2030 - TechSci Research
Field Device Management Market Report 2030 - TechSci Research
Vipin Mishra
?
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOTSMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
SMART SENTRY CYBER THREAT INTELLIGENCE IN IIOT
TanmaiArni
?
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
?
TrustArc Webinar - Building your DPIA/PIA Program: Best Practices & Tips
TrustArc Webinar - Building your DPIA/PIA Program: Best Practices & TipsTrustArc Webinar - Building your DPIA/PIA Program: Best Practices & Tips
TrustArc Webinar - Building your DPIA/PIA Program: Best Practices & Tips
TrustArc
?
1.1. Evolution-and-Scope-of-Business-Analytics.pptx
1.1. Evolution-and-Scope-of-Business-Analytics.pptx1.1. Evolution-and-Scope-of-Business-Analytics.pptx
1.1. Evolution-and-Scope-of-Business-Analytics.pptx
Jitendra Tomar
?
THE BIG TEN BIOPHARMACEUTICAL MNCs: GLOBAL CAPABILITY CENTERS IN INDIA
THE BIG TEN BIOPHARMACEUTICAL MNCs: GLOBAL CAPABILITY CENTERS IN INDIATHE BIG TEN BIOPHARMACEUTICAL MNCs: GLOBAL CAPABILITY CENTERS IN INDIA
THE BIG TEN BIOPHARMACEUTICAL MNCs: GLOBAL CAPABILITY CENTERS IN INDIA
Srivaanchi Nathan
?
Formal Methods: Whence and Whither? [Martin Fr?nzle Festkolloquium, 2025]
Formal Methods: Whence and Whither? [Martin Fr?nzle Festkolloquium, 2025]Formal Methods: Whence and Whither? [Martin Fr?nzle Festkolloquium, 2025]
Formal Methods: Whence and Whither? [Martin Fr?nzle Festkolloquium, 2025]
Jonathan Bowen
?
Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025
maharajput103
?
MIND Revenue Release Quarter 4 2024 - Finacial Presentation
MIND Revenue Release Quarter 4 2024 - Finacial PresentationMIND Revenue Release Quarter 4 2024 - Finacial Presentation
MIND Revenue Release Quarter 4 2024 - Finacial Presentation
MIND CTI
?
Early Adopter's Guide to AI Moderation (Preview)
Early Adopter's Guide to AI Moderation (Preview)Early Adopter's Guide to AI Moderation (Preview)
Early Adopter's Guide to AI Moderation (Preview)
nick896721
?
Unlock AI Creativity: Image Generation with DALL·E
Unlock AI Creativity: Image Generation with DALL·EUnlock AI Creativity: Image Generation with DALL·E
Unlock AI Creativity: Image Generation with DALL·E
Expeed Software
?
Backstage Software Templates for Java Developers
Backstage Software Templates for Java DevelopersBackstage Software Templates for Java Developers
Backstage Software Templates for Java Developers
Markus Eisele
?
UiPath Document Understanding - Generative AI and Active learning capabilities
UiPath Document Understanding - Generative AI and Active learning capabilitiesUiPath Document Understanding - Generative AI and Active learning capabilities
UiPath Document Understanding - Generative AI and Active learning capabilities
DianaGray10
?
Revolutionizing-Government-Communication-The-OSWAN-Success-Story
Revolutionizing-Government-Communication-The-OSWAN-Success-StoryRevolutionizing-Government-Communication-The-OSWAN-Success-Story
Revolutionizing-Government-Communication-The-OSWAN-Success-Story
ssuser52ad5e
?
Q4 2024 Earnings and Investor Presentation
Q4 2024 Earnings and Investor PresentationQ4 2024 Earnings and Investor Presentation
Q4 2024 Earnings and Investor Presentation
Dropbox
?
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog GavraReplacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
Replacing RocksDB with ScyllaDB in Kafka Streams by Almog Gavra
ScyllaDB
?
Gojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptxGojek Clone Multi-Service Super App.pptx
Gojek Clone Multi-Service Super App.pptx
V3cube
?
World Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a CrossroadsWorld Information Architecture Day 2025 - UX at a Crossroads
World Information Architecture Day 2025 - UX at a Crossroads
Joshua Randall
?
Technology use over time and its impact on consumers and businesses.pptx
Technology use over time and its impact on consumers and businesses.pptxTechnology use over time and its impact on consumers and businesses.pptx
Technology use over time and its impact on consumers and businesses.pptx
kaylagaze
?
Fl studio crack version 12.9 Free Download
Fl studio crack version 12.9 Free DownloadFl studio crack version 12.9 Free Download
Fl studio crack version 12.9 Free Download
kherorpacca127
?

「オブジェクト指向设计実践ガイド」を読んだので谁かに意见闻きたい

  • 4. class Gear def initialize(chainring, cog) @chainring = chainring @cog = cog end def ratio @chainring / @cog.to_f # end end : 2.3
  • 5. class Gear attr_reader :chainring, :cog # def initialize(chainring, cog) @chainring = chainring @cog = cog end def ratio chainring / cog.to_f # end end : 2.3
  • 7. : 3.2 class Gear attr_reader :chainring, :cog, :rim, :tire def initialize(chainring, cog, rim, tire) @chainring = chainring @cog = cog @rim = rim @tire = tire end def gear_inches # Wheel # Wheel ratio * Wheel.new(rim, tire).diameter end end Gear.new(52, 11, 26, 1.5).gear_inches
  • 8. : 3.2 class Gear attr_reader :chainring, :cog, :wheel def initialize(chainring, cog, wheel) @chainring = chainring @cog = cog @wheel = wheel end def gear_inches # diameter ratio * wheel.diameter end end # diameter Gear.new(52, 11, Wheel.new(26, 1.5)).gear_inches
  • 9. ? ? Wheel ? Wheel diameter ?
  • 10. : 3.2 class Gear attr_reader :chainring, :cog, :wheel def initialize(chainring, cog, wheel) @chainring = chainring @cog = cog @wheel = wheel end # ... end # Gear.new(52, 11, Wheel.new(26, 1.5)).gear_inches
  • 11. : 3.2 class Gear attr_reader :chainring, :cog, :wheel # Ruby2.1 def initialize(chainring:, cog:, wheel:) @chainring = chainring @cog = cog @wheel = wheel end # ... end # # Gear.new(chainring: 52, cog: 11, wheel: Wheel.new(26, 1.5))
  • 12. ? ? ?
  • 13. : 9.5 # prepare_trip class Mechanic def prepare_trip(trip) # ... end end class TripCoodinator def prepare_trip(trip) # ... end end class Driver def prepare_trip(trip) # ... end end
  • 14. : 9.5 # prepare_trip module PrepareInterfaceTest def test_implements_the_prepare_interface assert_respond_to(@object, :prepare_trip) end end # prepare_trip include class MechanicTest < MiniTest::Unit::TestCase include PrepareInterfaceTest def setup @mechanic = @object = Mechanic.new end end
  • 15. ? ? ?