Class: TakuhaiStatus::JapanPost
- Inherits:
-
Object
- Object
- TakuhaiStatus::JapanPost
- Defined in:
- lib/takuhai_status/japanpost.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #finish? ⇒ Boolean
-
#initialize(key) ⇒ JapanPost
constructor
A new instance of JapanPost.
Constructor Details
#initialize(key) ⇒ JapanPost
Returns a new instance of JapanPost.
9 10 11 12 13 |
# File 'lib/takuhai_status/japanpost.rb', line 9 def initialize(key) @key = key.strip raise NotMyKey.new('invalid key format') unless @key =~ /\A[a-zA-Z0-9]+\Z/ @time, @state = check end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/takuhai_status/japanpost.rb', line 6 def key @key end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/takuhai_status/japanpost.rb', line 6 def state @state end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
6 7 8 |
# File 'lib/takuhai_status/japanpost.rb', line 6 def time @time end |
Instance Method Details
#finish? ⇒ Boolean
15 16 17 |
# File 'lib/takuhai_status/japanpost.rb', line 15 def finish? return !!(@state =~ /差出人に返送済み|お届け済み|コンビニエンスストアに引渡|窓口でお渡し|転送|配達局から出発/) end |