Sha256: eaac25d1b2e1a2b9d08587959bec89ae05ce5d6d923c9306b5f24a5b3c09d45c

Contents?: true

Size: 1.61 KB

Versions: 5

Compression:

Stored size: 1.61 KB

Contents

Electricity=AMEE::DataAbstraction::PrototypeCalculation.new { # The application has support for an electricity calculation. :electricity is the internal label used to refer to it
  label :electricity
  name "Electricity Consumption"
  path '/business/energy/electricity/grid'
  
  drill {
    fixed 'argentina' #Not to be unset, value pre-given
    label :country  #Name will default to label.humanize if not given
    path 'country' #Some of the fields on the form are drill-downs, but the application doesn't need to display these differently
    #type :autocompleting_text_box #default for a drill with entries is probably a dropdown
  }

  profile {
    label :energy_used
    # Symbol provided here is used in generating html ids for elements etc
    path 'energyPerTime' #The amee profile item value corresponding to the field
    name "Energy Used" #The display name used on the form
    unit "kWh" #Default unit choice
    interface :text_box #Probably not needed, as likely to be the default for profile item value unsets
    validation lambda{|x|x.is_a? Float} #Probably not needed, as default can be deduced from PIV TYPE in API. Here as illustrative.
    alternative_units :MWh, :MBTU, :BTU # If these are explcitly specified then the alternatives are limited to only these units. Otherwise all dimensionally equivalent units are available as alternatives by default
  }
  
  # Alternatively, the drill might be fixed
  #permanent :country {
  #   drill_path 'country'
  #   value 'Argentina'

  output { #A marv output value
    label :co2
    path 'default' #It's not a marv, use the default output
    name "Carbon Dioxide"
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
amee-data-abstraction-2.3.1 spec/fixtures/config/electricity.rb
amee-data-abstraction-2.3.0 spec/fixtures/config/electricity.rb
amee-data-abstraction-2.2.2 spec/fixtures/config/electricity.rb
amee-data-abstraction-2.2.1 spec/fixtures/config/electricity.rb
amee-data-abstraction-2.2.0 spec/fixtures/config/electricity.rb