Class: Bsdkrun::NetworkInfo
- Inherits:
-
Data
- Object
- Data
- Bsdkrun::NetworkInfo
- Defined in:
- lib/bsdkrun/types.rb
Overview
A global network as reported by bsdkrun network ls --json.
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#gateway ⇒ Object
readonly
Returns the value of attribute gateway.
-
#members ⇒ Object
readonly
Returns the value of attribute members.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#running ⇒ Object
readonly
Returns the value of attribute running.
-
#subnet ⇒ Object
readonly
Returns the value of attribute subnet.
-
#up ⇒ Object
readonly
Returns the value of attribute up.
Class Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at
84 85 86 |
# File 'lib/bsdkrun/types.rb', line 84 def created_at @created_at end |
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway
84 85 86 |
# File 'lib/bsdkrun/types.rb', line 84 def gateway @gateway end |
#members ⇒ Object (readonly)
Returns the value of attribute members
84 85 86 |
# File 'lib/bsdkrun/types.rb', line 84 def members @members end |
#name ⇒ Object (readonly)
Returns the value of attribute name
84 85 86 |
# File 'lib/bsdkrun/types.rb', line 84 def name @name end |
#running ⇒ Object (readonly)
Returns the value of attribute running
84 85 86 |
# File 'lib/bsdkrun/types.rb', line 84 def running @running end |
#subnet ⇒ Object (readonly)
Returns the value of attribute subnet
84 85 86 |
# File 'lib/bsdkrun/types.rb', line 84 def subnet @subnet end |
#up ⇒ Object (readonly)
Returns the value of attribute up
84 85 86 |
# File 'lib/bsdkrun/types.rb', line 84 def up @up end |
Class Method Details
.from_row(row) ⇒ NetworkInfo
87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/bsdkrun/types.rb', line 87 def self.from_row(row) created = row["created_at"] new( name: row["name"].to_s, subnet: row["subnet"].to_s, gateway: row["gateway"].to_s, members: (row["members"] || 0).to_i, running: (row["running"] || 0).to_i, up: !!row["up"], created_at: created.nil? ? nil : created.to_i ) end |