Class: DJI::DHL::Checkpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/dji/dhl/checkpoint.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#counterObject

Returns the value of attribute counter.



7
8
9
# File 'lib/dji/dhl/checkpoint.rb', line 7

def counter
  @counter
end

#date_valueObject

Returns the value of attribute date_value.



9
10
11
# File 'lib/dji/dhl/checkpoint.rb', line 9

def date_value
  @date_value
end

#datetimeObject

Returns the value of attribute datetime.



10
11
12
# File 'lib/dji/dhl/checkpoint.rb', line 10

def datetime
  @datetime
end

#descriptionObject

Returns the value of attribute description.



8
9
10
# File 'lib/dji/dhl/checkpoint.rb', line 8

def description
  @description
end

#time_valueObject

Returns the value of attribute time_value.



9
10
11
# File 'lib/dji/dhl/checkpoint.rb', line 9

def time_value
  @time_value
end

Class Method Details

.new_from_item(item) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/dji/dhl/checkpoint.rb', line 14

def new_from_item(item)
  c = Checkpoint.new
  c.counter = item['counter']
  c.description = item['description']
  c.time_value = item['time']
  c.date_value = item['date']
  c.datetime = Time.parse("#{c.date_value}#{c.time_value}")
  c
end