Class: CmdbAsset
- Inherits:
-
Object
- Object
- CmdbAsset
- Defined in:
- lib/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.
-
#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.
-
#operating_system ⇒ Object
Returns the value of attribute operating_system.
-
#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:, sub_area:, application:, utr:, fqdn:, host_name:, ip_address:, operating_system:, server_environment:, server_category:, host_key:, country:) ⇒ CmdbAsset
constructor
A new instance of CmdbAsset.
- #site_name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(id:, country_code:, business_unit:, sub_area:, application:, utr:, fqdn:, host_name:, ip_address:, operating_system:, server_environment:, server_category:, host_key:, country:) ⇒ CmdbAsset
Returns a new instance of CmdbAsset.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/asset/model.rb', line 17 def initialize(id:, country_code:, business_unit:, sub_area:, application:, utr:, fqdn:, host_name:, ip_address:, operating_system:, server_environment:, server_category:, host_key:, country:) @id = id @country_code = country_code @business_unit = business_unit @sub_area = sub_area @application = application @utr = utr @fqdn = fqdn @host_name = host_name @ip_address = ip_address @operating_system = @server_category = server_category @server_environment = server_environment @host_key = host_key @country = country end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def application @application end |
#business_unit ⇒ Object
Returns the value of attribute business_unit.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def business_unit @business_unit end |
#country ⇒ Object
Returns the value of attribute country.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def country @country end |
#country_code ⇒ Object
Returns the value of attribute country_code.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def country_code @country_code end |
#fqdn ⇒ Object
Returns the value of attribute fqdn.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def fqdn @fqdn end |
#host_key ⇒ Object
Returns the value of attribute host_key.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def host_key @host_key end |
#host_name ⇒ Object
Returns the value of attribute host_name.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def host_name @host_name end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def id @id end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def ip_address @ip_address end |
#operating_system ⇒ Object
Returns the value of attribute operating_system.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def @operating_system end |
#server_category ⇒ Object
Returns the value of attribute server_category.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def server_category @server_category end |
#server_environment ⇒ Object
Returns the value of attribute server_environment.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def server_environment @server_environment end |
#sub_area ⇒ Object
Returns the value of attribute sub_area.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def sub_area @sub_area end |
#utr ⇒ Object
Returns the value of attribute utr.
2 3 4 |
# File 'lib/asset/model.rb', line 2 def utr @utr end |
Class Method Details
.from_csv(row) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/asset/model.rb', line 51 def self.from_csv(row) CmdbAsset.new(id: row[:id], country_code: row[:country_code], country: row[:country], business_unit: row[:business_unit], 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]) end |
Instance Method Details
#site_name ⇒ Object
47 48 49 |
# File 'lib/asset/model.rb', line 47 def site_name ['', country_code, business_unit, sub_area, application, utr].join(':') end |
#to_s ⇒ Object
68 69 70 |
# File 'lib/asset/model.rb', line 68 def to_s [id, site_name, fqdn, ip_address].join ',' end |