Class: TakuhaiStatus::TMGCargo

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

Constant Summary collapse

@@conn =
nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ TMGCargo

Returns a new instance of TMGCargo.

Raises:



12
13
14
15
16
# File 'lib/takuhai_status/tmg_cargo.rb', line 12

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.



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

def key
  @key
end

#stateObject (readonly)

Returns the value of attribute state.



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

def state
  @state
end

#timeObject (readonly)

Returns the value of attribute time.



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

def time
  @time
end

Instance Method Details

#finish?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/takuhai_status/tmg_cargo.rb', line 18

def finish?
	return !!(@state =~ /配達完了|返品/)
end