Sha256: 1b9381068bd471b6f98d85f95aee93026dd14b5c33b1b179ce884d795cd771db

Contents?: true

Size: 713 Bytes

Versions: 14

Compression:

Stored size: 713 Bytes

Contents

module Brightbox
  class Type < Api
    def self.require_account?; true; end

    def attributes
      o = fog_model.attributes
      o[:ram] = ram
      o[:disk] = disk
      o
    end

    def ram
      fog_model.ram.to_i
    end

    def disk
      fog_model.disk.to_i
    end

    def to_row
      attributes
    end

    def render_cell
      fog_model.handle
    end

    def self.all
      conn.flavors
    end

    def self.get(id)
      conn.flavors.get id
    end

    def self.default_field_order
      %i[id name handle ram disk cores]
    end

    def <=>(other)
      ram <=> if other.is_a? Type
                other.ram
              else
                other
              end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
brightbox-cli-4.8.0 lib/brightbox-cli/types.rb
brightbox-cli-4.7.0 lib/brightbox-cli/types.rb
brightbox-cli-4.6.0 lib/brightbox-cli/types.rb
brightbox-cli-4.5.0 lib/brightbox-cli/types.rb
brightbox-cli-4.5.0.rc1 lib/brightbox-cli/types.rb
brightbox-cli-4.4.0 lib/brightbox-cli/types.rb
brightbox-cli-4.3.2 lib/brightbox-cli/types.rb
brightbox-cli-4.3.1 lib/brightbox-cli/types.rb
brightbox-cli-4.3.0 lib/brightbox-cli/types.rb
brightbox-cli-4.2.1 lib/brightbox-cli/types.rb
brightbox-cli-4.2.0 lib/brightbox-cli/types.rb
brightbox-cli-4.1.0 lib/brightbox-cli/types.rb
brightbox-cli-4.0.0 lib/brightbox-cli/types.rb
brightbox-cli-4.0.0.rc2 lib/brightbox-cli/types.rb