require "amee/data_api/data_item_value" require "amee/data_api/item_definition" module Amee module DataApi class DataItem require "amee/data_api/data_category" include Amee::Model self.path_prefix = "/data" attr_accessor :start_date, :end_date, :label, :choices, :kg_c_o2_per_k_wh, :source list_populators :item_values => {:class => Amee::DataApi::DataItemValue} item_populators :data_category => {:class => Amee::DataApi::DataCategory}, :item_definition => {:class => Amee::DataApi::ItemDefinition} def populate! session.api_call(:get, "data.item", self.full_path) do |response| populate_from_hash!(response) end end def kg_co2_per_kwh kg_c_o2_per_k_wh end end end end