Skip to content

Instantly share code, notes, and snippets.

View xhackjp1's full-sized avatar
🏠
Working from home

matsuda shinsuke xhackjp1

🏠
Working from home
View GitHub Profile
@xhackjp1
xhackjp1 / state_pattern.rb
Created October 6, 2019 07:25 — forked from travisjeffery/state_pattern.rb
State Pattern in Ruby
# State - allow an object to alter its behaviour when its internal state
# changes. The object will appear to change its class.
# Key idea - introduce an abstract class called SomethingState to represent the
# states of the object. Subclasses of the abstract class implement
# state-specific behaviour.
class Person
attr_accessor :state, :name
@xhackjp1
xhackjp1 / state_pattern.rb
Created October 6, 2019 07:25 — forked from travisjeffery/state_pattern.rb
State Pattern in Ruby
# State - allow an object to alter its behaviour when its internal state
# changes. The object will appear to change its class.
# Key idea - introduce an abstract class called SomethingState to represent the
# states of the object. Subclasses of the abstract class implement
# state-specific behaviour.
class Person
attr_accessor :state, :name
@xhackjp1
xhackjp1 / gist:f02c389c70703f2b88818ae18a0ac237
Created June 18, 2019 01:11 — forked from yhara/gist:3087849
Ruby Twitter Gem cheat sheet (ja) v2.1.0
Ruby Twitter Gemの簡易リファレンス(というかメモ)です。内容はバージョン2.1.0に準拠しています。
{{toc_here}}
! インストール
$ gem install twitter -v=2.1.0
(環境によっては sudo gem ~)
! 概要
* 公式サイト:https://github.com/jnunemaker/twitter