電波ビーチ

☆(ゝω・)v

2018-11-25から1日間の記事一覧

Ruby オブジェクト -> hash -> json

アロー演算子じゃないです。 インスタンス変数: 値 みたいな感じで require 'json' require 'time' class Hito attr_accessor :age, :name, :id def initialize(age, name) @age = age @name = name @id = Time.new.iso8601(6) end end human = Hash.new a =…