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.

Raises:



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

def initialize(key)
	@key = key.strip
	raise NotMyKey.new('invalid key format') unless @key =~ /\A[0-9]+\Z/
	@time, @state = check
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

#stateObject (readonly)

Returns the value of attribute state.



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

def state
  @state
end

#timeObject (readonly)

Returns the value of attribute time.



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

def time
  @time
end

Instance Method Details

#finish?Boolean

Returns:

  • (Boolean)


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

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