Class: TakuhaiStatus::KuronekoYamato

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ KuronekoYamato

Returns a new instance of KuronekoYamato.

Raises:



9
10
11
12
13
# File 'lib/takuhai_status/kuronekoyamato.rb', line 9

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.



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

def key
  @key
end

#stateObject (readonly)

Returns the value of attribute state.



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

def state
  @state
end

#timeObject (readonly)

Returns the value of attribute time.



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

def time
  @time
end

Instance Method Details

#finish?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/takuhai_status/kuronekoyamato.rb', line 15

def finish?
	return !!(@state =~ /^(お客様引渡|配達|投函)完了|返品/)
end