Class: TakuhaiStatus::Sagawa

Inherits:
Object
  • Object
show all
Defined in:
lib/takuhai_status/sagawa.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ Sagawa

Returns a new instance of Sagawa.



8
9
10
11
# File 'lib/takuhai_status/sagawa.rb', line 8

def initialize(key)
  @key = key.gsub(/[^0-9]/, '')
  @time, @state = check
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



6
7
8
# File 'lib/takuhai_status/sagawa.rb', line 6

def key
  @key
end

#stateObject (readonly)

Returns the value of attribute state.



6
7
8
# File 'lib/takuhai_status/sagawa.rb', line 6

def state
  @state
end

#timeObject (readonly)

Returns the value of attribute time.



6
7
8
# File 'lib/takuhai_status/sagawa.rb', line 6

def time
  @time
end

Instance Method Details

#finish?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/takuhai_status/sagawa.rb', line 13

def finish?
  return !!(@state =~ /営業所へお問い合わせ下さい。|配達は終了致しました。$|^配達完了/)
end