Class: GreenButtonData::RetailCustomer

Inherits:
Entry
  • Object
show all
Defined in:
lib/green-button-data/retail_customer.rb

Instance Attribute Summary collapse

Attributes inherited from Entry

#id, #token, #usage_point_id

Instance Method Summary collapse

Methods inherited from Entry

#initialize

Methods included from Utilities

#attributes_to_hash, #class_from_name, #epoch_to_time, #first_sunday_of, #last_weekday_of, #normalize_epoch, #nth_weekday_of, #parse_datetime, #weekday_offset

Methods included from Fetchable

included

Constructor Details

This class inherits a constructor from GreenButtonData::Entry

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



3
4
5
# File 'lib/green-button-data/retail_customer.rb', line 3

def 
  @account_id
end

#customer_agreement_idObject (readonly)

Returns the value of attribute customer_agreement_id.



3
4
5
# File 'lib/green-button-data/retail_customer.rb', line 3

def customer_agreement_id
  @customer_agreement_id
end

Returns the value of attribute links.



3
4
5
# File 'lib/green-button-data/retail_customer.rb', line 3

def links
  @links
end

#meter_interval_lengthObject (readonly)

Returns the value of attribute meter_interval_length.



3
4
5
# File 'lib/green-button-data/retail_customer.rb', line 3

def meter_interval_length
  @meter_interval_length
end

#meter_serial_numberObject (readonly)

Returns the value of attribute meter_serial_number.



3
4
5
# File 'lib/green-button-data/retail_customer.rb', line 3

def meter_serial_number
  @meter_serial_number
end

#meter_typeObject (readonly)

Returns the value of attribute meter_type.



3
4
5
# File 'lib/green-button-data/retail_customer.rb', line 3

def meter_type
  @meter_type
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/green-button-data/retail_customer.rb', line 3

def name
  @name
end

Instance Method Details

#address_generalObject



19
20
21
# File 'lib/green-button-data/retail_customer.rb', line 19

def address_general
  @main_address.to_s
end

#agreement_id_service_uuid_mapObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/green-button-data/retail_customer.rb', line 23

def agreement_id_service_uuid_map
  result = {}

  if has_agreement_id_map?
    result[:customer_agreement_id] = customer_agreement_id
    result[:service_uuid] = service_uuid
  end

  result
end

#has_address?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/green-button-data/retail_customer.rb', line 11

def has_address?
  present?(address_general)
end

#has_agreement_id_map?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/green-button-data/retail_customer.rb', line 15

def has_agreement_id_map?
  present?(customer_agreement_id)
end