Class: Zakuro::Gateway::Range
- Inherits:
-
Object
- Object
- Zakuro::Gateway::Range
- Defined in:
- lib/zakuro/gateway/range.rb
Overview
Range 範囲
Instance Attribute Summary collapse
-
#context ⇒ Context::Context
readonly
暦コンテキスト.
-
#range ⇒ Locale::Range
readonly
範囲.
Instance Method Summary collapse
-
#get ⇒ Result::Range
検索結果を取得する.
-
#initialize(context:, range:) ⇒ Range
constructor
初期化.
-
#invalid? ⇒ True, False
不正か.
Constructor Details
Instance Attribute Details
#context ⇒ Context::Context (readonly)
Returns 暦コンテキスト.
19 20 21 |
# File 'lib/zakuro/gateway/range.rb', line 19 def context @context end |
#range ⇒ Locale::Range (readonly)
Returns 範囲.
21 22 23 |
# File 'lib/zakuro/gateway/range.rb', line 21 def range @range end |
Instance Method Details
#get ⇒ Result::Range
検索結果を取得する
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/zakuro/gateway/range.rb', line 49 def get start_date = range.start_date last_date = range.last_date return western(start_date: start_date, last_date: last_date) if range.valid_western? return japan(start_date: start_date, last_date: last_date) if range.valid_japan? raise Exception.get( presets: [ Exception::Case::Preset.new( template: Exception::Case::Pattern::INVALID_RANGE ) ] ) end |
#invalid? ⇒ True, False
不正か
40 41 42 |
# File 'lib/zakuro/gateway/range.rb', line 40 def invalid? range.invalid? end |