- thinをつかう
- 使用できなかった! ※rubyのバージョンのせい?ruby2.4使用中ruby2.2に変更したら、使用できた!
- streamをつかう - APIをいろいろ試してみる
- 機械学習API)
- Sinatra Test
- http://docs.seattlerb.org/minitest/Minitest/Assertions.html
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
# frozen_string_literal: true | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
gem "rspec" | |
gem "guard-rspec" | |
gem 'wdm' | |
gem "win32console" |
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
arr1 = [1,2,3,4] | |
arr2 = arr1 | |
arr3 = arr1.clone | |
arr1.reverse! | |
p arr1 | |
# [4,3,2,1] | |
p arr2 |
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
arr1=[1,2,3,4,5] | |
arr2=[1,2,3,4,5] | |
arr3=[1,2,3,4] | |
arr4=[1,2,3,5] | |
arr5=[1000,2000,3000] | |
arr6=[1,2] | |
arr7=[2,1] | |
arr8=["hello", "world"] | |
arr9=["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 MyArray < Array | |
include Comparable | |
# 配列の最小値で比較できるようにオーバーライド | |
def <=> ( anotherArray ) | |
self.min <=> anotherArray.min | |
end | |
end | |
myarr1 = MyArray.new([0,1,2,3]) |
OlderNewer