class Oneview::Entity::Contact

Attributes

address[RW]
birthday[RW]
city[RW]
dynamic_fields[RW]
email[RW]
id[RW]
name[RW]
phone[RW]
state[RW]
zip_code[RW]

Public Class Methods

new() click to toggle source
# File lib/oneview/entity/contact.rb, line 6
def initialize
  self.phone = Phone.new
  self.dynamic_fields = Array.new
end

Public Instance Methods

as_parameter() click to toggle source
# File lib/oneview/entity/contact.rb, line 11
def as_parameter
  variables = instance_variables.map do |name|
    case name
    when :@phone
      ["phone_attributes", instance_variable_get(name).as_parameter]
    when :@dynamic_fields
    else 
      [name.to_s.tr("@", ""), instance_variable_get(name)]
    end
  end
  
  self.dynamic_fields.each do |dynamic_field|
    variables << [dynamic_field.name, dynamic_field.value]
  end
  
  Hash[variables.compact]
end