Sha256: 0e13a6123c3c002261e32a30ccc636848a6b8ee548f77d494c64905130f52895
Contents?: true
Size: 1.04 KB
Versions: 19
Compression:
Stored size: 1.04 KB
Contents
module Rubix class HostGroup < Model # # == Properties & Finding == # def initialize properties={} super(properties) @name = properties[:name] self.host_ids = properties[:host_ids] self.hosts = properties[:hosts] end attr_accessor :name def self.id_field 'groupid' end # # == Associations == # include Associations::HasManyHosts # # == Requests == # def create_params {:name => name} end def destroy_params [{id_field => id}] end def self.get_params super().merge(:select_hosts => :refer) end def self.find_params options={} get_params.merge(:filter => {id_field => options[:id], :name => options[:name]}) end def self.build host_group new({ :id => host_group[id_field].to_i, :name => host_group['name'], :host_ids => host_group['hosts'].map { |host_info| host_info['hostid'].to_i } }) end end end
Version data entries
19 entries across 19 versions & 1 rubygems