Class: GreenButton::Parser::GbDataFeed

Inherits:
Object
  • Object
show all
Includes:
SAXMachine
Defined in:
lib/ce-greenbutton/elements/gb_data_feed.rb

Overview

a sax-machine mapping for the espi:DataFeed structure

For example:

data_feed = GbDataFeed.parse(open(data_feed.xml))

Author: ahmed.seddiq Version: 1.0

Instance Method Summary collapse

Instance Method Details

Get the related entry to the given entry of the given type

entry - the parent entry. type - the type of the required entry,e.g. ‘MeterReading’

Note: This method should be only called on instances returned from Parser.parse method.

Returns the related GbEntry



28
29
30
31
# File 'lib/ce-greenbutton/elements/gb_data_feed.rb', line 28

def get_related (entry, type)
  related_entry_key = entry.related[type] unless entry.related.nil?
  self.entries[related_entry_key]
end