Class: PecCalcClient::Place

Inherits:
Object
  • Object
show all
Defined in:
lib/pec_calc_client/place.rb

Constant Summary collapse

PLACE_PARAMS =
%w( width length height volume weight oversized sturdy_packaging )

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Place

Returns a new instance of Place.



7
8
9
# File 'lib/pec_calc_client/place.rb', line 7

def initialize(params)
  params.each { |k, v| instance_variable_set("@#{k}", v) if PLACE_PARAMS.include? k.to_s }
end

Instance Method Details

#to_aObject



11
12
13
# File 'lib/pec_calc_client/place.rb', line 11

def to_a
  PLACE_PARAMS.map { |k| instance_variable_get("@#{k}") }
end