2021/07/28
Atlassian Community Events Japan (#ACEJ) #47
https://ace.atlassian.com/events/details/atlassian-tokyo-presents-47-tokyo-atlassian-community-online-meetup-cloudyi-xing-yuzashi-li-jsmhuo-yong-shi-li-/
2021/07/28
Atlassian Community Events Japan (#ACEJ) #47
https://ace.atlassian.com/events/details/atlassian-tokyo-presents-47-tokyo-atlassian-community-online-meetup-cloudyi-xing-yuzashi-li-jsmhuo-yong-shi-li-/
While known for its first-class JSON handling for Java, Jackson is not limited to JSON: with no fewer than 9 supported data formats it can be used for reading and writing data in almost any data format. This talk offers introduction to reading and writing XML and CSV using Jackson.
24. 社員コード
?
module Salary
def calculate_salary
kihon + teate
end
def kihon
@kihonkyu
end
def teate
0
end
end
class Shain
include Salary
def initialize(kihonkyu)
@kihonkyu = kihonkyu
end
end
class Tanto < Shain
def standup
"新入社員は慌てて起立しました"
end
end
第2回のコード
25. ?? まずはテストの作成
?
?? Rspecを使用
テスト
?
# -*- coding: utf-8 -*-
require_relative './shain'
describe ShainFactory do
let(:shain_factory) {ShainFactory.new}
it ' Tantoオブジェクトを生成しているかどうかをチェックする' do
expect(shain_factory.create('Tanto',100)).to be_an_instance_of Tanto
end
?
end
30. 演習2? ?車車、トラック、タイヤクラス
?
class Tire
def spin_car
"spinning car tire"
end
def spin_truck
"spinning truck tire"
end
end
class Vehicle
def initialize
@tire = Tire.new
end
end
class Car < Vehicle
def move_forward
puts "前進する"
return @tire.spin_car
end
end
class Truck < Vehicle
def move_forward
puts "前進する"
return @tire.spin_truck
end
end
31. 演習2? RSpec
?
# -*- coding: utf-8 -*-
require_relative './vehicle'
describe Car do
let(:car) {Car.new}
it ' spining car tireを返すかどうかをチェックする' do
expect(car.move_forward).to eq 'spinning car tire'
end
end
describe Truck do
let(:truck) {Truck.new}
it ' spining truck tireを返すかどうかをチェックする' do
expect(truck.move_forward).to eq 'spinning truck tire'
end