Class: CmdbAsset
- Inherits:
-
Object
- Object
- CmdbAsset
- Defined in:
- lib/domain/asset/model.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#business_unit ⇒ Object
Returns the value of attribute business_unit.
-
#business_unit_code ⇒ Object
Returns the value of attribute business_unit_code.
-
#country ⇒ Object
Returns the value of attribute country.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#fqdn ⇒ Object
Returns the value of attribute fqdn.
-
#host_key ⇒ Object
Returns the value of attribute host_key.
-
#host_name ⇒ Object
Returns the value of attribute host_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#is_subnet_in_server_range ⇒ Object
Returns the value of attribute is_subnet_in_server_range.
-
#matching_fqdn ⇒ Object
Returns the value of attribute matching_fqdn.
-
#matching_host_name ⇒ Object
Returns the value of attribute matching_host_name.
-
#matching_ip_address ⇒ Object
Returns the value of attribute matching_ip_address.
-
#onboard_asset ⇒ Object
Returns the value of attribute onboard_asset.
-
#operating_system ⇒ Object
Returns the value of attribute operating_system.
-
#reported_decommissioned ⇒ Object
Returns the value of attribute reported_decommissioned.
-
#server_category ⇒ Object
Returns the value of attribute server_category.
-
#server_environment ⇒ Object
Returns the value of attribute server_environment.
-
#sub_area ⇒ Object
Returns the value of attribute sub_area.
-
#utr ⇒ Object
Returns the value of attribute utr.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, country_code:, business_unit:, business_unit_code:, sub_area:, application:, utr:, fqdn:, host_name:, ip_address:, operating_system:, server_environment:, server_category:, host_key:, country:, matching_fqdn:, matching_host_name:, matching_ip_address:, is_subnet_in_server_range:, reported_decommissioned:, onboard_asset:) ⇒ CmdbAsset
constructor
A new instance of CmdbAsset.
- #onboard? ⇒ Boolean
- #site_name ⇒ Object
- #to_s ⇒ Object
- #utr_tag_names ⇒ Object
Constructor Details
#initialize(id:, country_code:, business_unit:, business_unit_code:, sub_area:, application:, utr:, fqdn:, host_name:, ip_address:, operating_system:, server_environment:, server_category:, host_key:, country:, matching_fqdn:, matching_host_name:, matching_ip_address:, is_subnet_in_server_range:, reported_decommissioned:, onboard_asset:) ⇒ CmdbAsset
Returns a new instance of CmdbAsset.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/domain/asset/model.rb', line 48 def initialize( id:, country_code:, business_unit:, business_unit_code:, sub_area:, application:, utr:, fqdn:, host_name:, ip_address:, operating_system:, server_environment:, server_category:, host_key:, country:, matching_fqdn:, matching_host_name:, matching_ip_address:, is_subnet_in_server_range:, reported_decommissioned:, onboard_asset: ) @id = id @country_code = country_code @business_unit = business_unit @business_unit_code = business_unit_code @sub_area = sub_area @application = application @utr = utr @fqdn = fqdn @host_name = host_name @ip_address = ip_address = @server_category = server_category @server_environment = server_environment @host_key = host_key @country = country @matching_fqdn = matching_fqdn @matching_host_name = matching_host_name @matching_ip_address = matching_ip_address @is_subnet_in_server_range = is_subnet_in_server_range @reported_decommissioned = reported_decommissioned @onboard_asset = onboard_asset end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def application @application end |
#business_unit ⇒ Object
Returns the value of attribute business_unit.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def business_unit @business_unit end |
#business_unit_code ⇒ Object
Returns the value of attribute business_unit_code.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def business_unit_code @business_unit_code end |
#country ⇒ Object
Returns the value of attribute country.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def country @country end |
#country_code ⇒ Object
Returns the value of attribute country_code.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def country_code @country_code end |
#fqdn ⇒ Object
Returns the value of attribute fqdn.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def fqdn @fqdn end |
#host_key ⇒ Object
Returns the value of attribute host_key.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def host_key @host_key end |
#host_name ⇒ Object
Returns the value of attribute host_name.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def host_name @host_name end |
#id ⇒ Object
Returns the value of attribute id.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def id @id end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def ip_address @ip_address end |
#is_subnet_in_server_range ⇒ Object
Returns the value of attribute is_subnet_in_server_range.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def is_subnet_in_server_range @is_subnet_in_server_range end |
#matching_fqdn ⇒ Object
Returns the value of attribute matching_fqdn.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def matching_fqdn @matching_fqdn end |
#matching_host_name ⇒ Object
Returns the value of attribute matching_host_name.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def matching_host_name @matching_host_name end |
#matching_ip_address ⇒ Object
Returns the value of attribute matching_ip_address.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def matching_ip_address @matching_ip_address end |
#onboard_asset ⇒ Object
Returns the value of attribute onboard_asset.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def onboard_asset @onboard_asset end |
#operating_system ⇒ Object
Returns the value of attribute operating_system.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def end |
#reported_decommissioned ⇒ Object
Returns the value of attribute reported_decommissioned.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def reported_decommissioned @reported_decommissioned end |
#server_category ⇒ Object
Returns the value of attribute server_category.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def server_category @server_category end |
#server_environment ⇒ Object
Returns the value of attribute server_environment.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def server_environment @server_environment end |
#sub_area ⇒ Object
Returns the value of attribute sub_area.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def sub_area @sub_area end |
#utr ⇒ Object
Returns the value of attribute utr.
26 27 28 |
# File 'lib/domain/asset/model.rb', line 26 def utr @utr end |
Class Method Details
.from_csv(row) ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/domain/asset/model.rb', line 108 def self.from_csv(row) CmdbAsset.new( id: row[:id], country_code: row[:country_code], country: row[:country], business_unit: row[:business_unit], business_unit_code: row[:business_unit_code], sub_area: row[:sub_area], application: row[:application], utr: row[:utr], fqdn: row[:fqdn], ip_address: row[:ip_address], host_name: row[:host_name], host_key: row[:host_key], operating_system: row[:operating_system], server_environment: row[:server_environment], server_category: row[:server_category], matching_fqdn: row[:matching_fqdn], matching_host_name: row[:matching_host_name], matching_ip_address: row[:matching_ip_address], is_subnet_in_server_range: row[:is_subnet_in_server_range], reported_decommissioned: row[:reported_decommissioned], onboard_asset: row[:onboard_asset] ) end |
Instance Method Details
#onboard? ⇒ Boolean
95 96 97 |
# File 'lib/domain/asset/model.rb', line 95 def onboard? onboard_asset end |
#site_name ⇒ Object
99 100 101 |
# File 'lib/domain/asset/model.rb', line 99 def site_name ['', country_code, business_unit_code, sub_area, application, utr].join(':') end |
#to_s ⇒ Object
134 135 136 |
# File 'lib/domain/asset/model.rb', line 134 def to_s [id, site_name, fqdn, ip_address].join ',' end |
#utr_tag_names ⇒ Object
103 104 105 106 |
# File 'lib/domain/asset/model.rb', line 103 def utr_tag_names app_utr = [application, utr].join ' - ' [business_unit_code, sub_area, app_utr, country] end |