Class: Belpost::Models::Parcel

Inherits:
Object
  • Object
show all
Defined in:
lib/belpost/models/parcel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Parcel

Returns a new instance of Parcel.



8
9
10
# File 'lib/belpost/models/parcel.rb', line 8

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



6
7
8
# File 'lib/belpost/models/parcel.rb', line 6

def data
  @data
end

Instance Method Details

#to_hObject



12
13
14
# File 'lib/belpost/models/parcel.rb', line 12

def to_h
  data
end

#to_json(*_args) ⇒ Object



16
17
18
# File 'lib/belpost/models/parcel.rb', line 16

def to_json(*_args)
  data.to_json
end