lib/openbd/resources/openbd_item.rb in openbd_api-0.4.3 vs lib/openbd/resources/openbd_item.rb in openbd_api-0.4.4

- old
+ new

@@ -1,24 +1,24 @@ module OpenBD module Resources class OpenbdItem < BaseResource def initialize(source) @source = source - @hanmoto = ::OpenBD::Resources::Hanmoto.new(source['hanmoto']) - @onix = ::OpenBD::Resources::Onix.new(source['onix']) - @summary = ::OpenBD::Resources::Summary.new(source['summary']) + @hanmoto = nil + @onix = nil + @summary = nil end def onix - @onix + @onix ||= ::OpenBD::Resources::Onix.new(source['onix']) end def hanmoto - @hanmoto + @hanmoto ||= ::OpenBD::Resources::Hanmoto.new(source['hanmoto']) end def summary - @summary + @summary ||= ::OpenBD::Resources::Summary.new(source['summary']) end end end end