class PIM::CommunicationChannel

Attributes

channel_values[RW]
name[RW]
plan[RW]
plan_values[RW]
type[RW]

Public Class Methods

new(name, type, plan) click to toggle source
# File pim.rb, line 10011
def initialize name, type, plan
  @name = name
  @type = type
  @channel_values = {}
  @plan = plan
  @plan_values = {}
end

Public Instance Methods

as_json() click to toggle source
# File pim.rb, line 10019
def as_json
  json = {
    :name => @name,
    :type => @type,
    :plan => @plan,
    :dataModel => self.class.data_module.to_s,
    :channelValues => @channel_values,
    :planValues => @plan_values
  }
  @channel_values.each_pair do |name, value|
    json[name] = value if not json.include?(name)
  end
  json
end
channel_value(name, value = nil) click to toggle source
# File pim.rb, line 10034
def channel_value name, value = nil
  name = PIM.to_sym(name)
  @channel_values[name] = value if value
  @channel_values[name]
end
plan_value(name, value = nil) click to toggle source
# File pim.rb, line 10040
def plan_value name, value = nil
  name = PIM.to_sym(name)
  @plan_values[name] = value if value
  @plan_values[name]
end