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
319 320 321 |
# File 'lib/bsdkrun/types.rb', line 319 def created_at @created_at end |
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway
319 320 321 |
# File 'lib/bsdkrun/types.rb', line 319 def gateway @gateway end |
#members ⇒ Object (readonly)
Returns the value of attribute members
319 320 321 |
# File 'lib/bsdkrun/types.rb', line 319 def members @members end |
#name ⇒ Object (readonly)
Returns the value of attribute name
319 320 321 |
# File 'lib/bsdkrun/types.rb', line 319 def name @name end |
#running ⇒ Object (readonly)
Returns the value of attribute running
319 320 321 |
# File 'lib/bsdkrun/types.rb', line 319 def running @running end |
#subnet ⇒ Object (readonly)
Returns the value of attribute subnet
319 320 321 |
# File 'lib/bsdkrun/types.rb', line 319 def subnet @subnet end |
#up ⇒ Object (readonly)
Returns the value of attribute up
319 320 321 |
# File 'lib/bsdkrun/types.rb', line 319 def up @up end |
Class Method Details
.from_row(row) ⇒ NetworkInfo
322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/bsdkrun/types.rb', line 322 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 |