以下の内容はhttps://tbpgr.hatenablog.com/entry/20140326/1395851472より取得しました。


ActiveSupport | Range#include?

概要

Range#include?

詳細

Range#include? について

Range#include?

引数が範囲に含まれているか確認する

サンプル

# encoding: utf-8
require 'active_support/core_ext/range/include_range'
require 'tbpgr_utils'

bulk_puts_eval binding, <<-EOS
(1..5).include? 1
(1..5).include? 5
(1..5).include? 6
(1..5).include? (1..5)
(1..5).include? (2..4)
(1..5).include? (1..6)
EOS

__END__
・下記はTbpgrUtils gemの機能
bulk_puts_eval

https://rubygems.org/gems/tbpgr_utils
https://github.com/tbpgr/tbpgr_utils

出力

(1..5).include? 1 # => true
(1..5).include? 5 # => true
(1..5).include? 6 # => false
(1..5).include? (1..5) # => true
(1..5).include? (2..4) # => true
(1..5).include? (1..6) # => false



以上の内容はhttps://tbpgr.hatenablog.com/entry/20140326/1395851472より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14