Class: Oneview::Entity::Contact
- Inherits:
-
Object
- Object
- Oneview::Entity::Contact
- Defined in:
- lib/oneview/entity/contact.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#birthday ⇒ Object
Returns the value of attribute birthday.
-
#city ⇒ Object
Returns the value of attribute city.
-
#dynamic_fields ⇒ Object
Returns the value of attribute dynamic_fields.
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#state ⇒ Object
Returns the value of attribute state.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
Instance Method Summary collapse
- #as_parameter ⇒ Object
-
#initialize ⇒ Contact
constructor
A new instance of Contact.
Constructor Details
#initialize ⇒ Contact
Returns a new instance of Contact.
6 7 8 9 |
# File 'lib/oneview/entity/contact.rb', line 6 def initialize self.phone = Phone.new self.dynamic_fields = Array.new end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def address @address end |
#birthday ⇒ Object
Returns the value of attribute birthday.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def birthday @birthday end |
#city ⇒ Object
Returns the value of attribute city.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def city @city end |
#dynamic_fields ⇒ Object
Returns the value of attribute dynamic_fields.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def dynamic_fields @dynamic_fields end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def name @name end |
#phone ⇒ Object
Returns the value of attribute phone.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def phone @phone end |
#state ⇒ Object
Returns the value of attribute state.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def state @state end |
#zip_code ⇒ Object
Returns the value of attribute zip_code.
4 5 6 |
# File 'lib/oneview/entity/contact.rb', line 4 def zip_code @zip_code end |
Instance Method Details
#as_parameter ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# 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 |