Class: Ocar::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/ocar/status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Status

Returns a new instance of Status.



6
7
8
9
10
11
12
13
# File 'lib/ocar/status.rb', line 6

def initialize(json)
  @number = json['data'][0]['numeroPieza'].to_s
  @owner = json['data'][0]['titular']
  @description = json['data'][0]['descripcion']
  @date = json['data'][0]['fecha']
  @location = json['data'][0]['sucursal']
  @type = json['data'][0]['tipo']
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



4
5
6
# File 'lib/ocar/status.rb', line 4

def date
  @date
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/ocar/status.rb', line 4

def description
  @description
end

#locationObject (readonly)

Returns the value of attribute location.



4
5
6
# File 'lib/ocar/status.rb', line 4

def location
  @location
end

#numberObject (readonly)

Returns the value of attribute number.



4
5
6
# File 'lib/ocar/status.rb', line 4

def number
  @number
end

#ownerObject (readonly)

Returns the value of attribute owner.



4
5
6
# File 'lib/ocar/status.rb', line 4

def owner
  @owner
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/ocar/status.rb', line 4

def type
  @type
end