Sha256: 54a00e6389f6b02cb1d5aa704d7bac22468d113568478e1bdca01d5fe1e8edcc

Contents?: true

Size: 1.61 KB

Versions: 5

Compression:

Stored size: 1.61 KB

Contents

#
# Copyright (C) 2009  Red Hat, Inc.
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.  The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License.  You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
# License for the specific language governing permissions and limitations
# under the License.


class Instance < BaseModel

  attr_accessor :owner_id
  attr_accessor :image_id
  attr_accessor :name
  attr_accessor :realm_id
  attr_accessor :state
  attr_accessor :actions
  attr_accessor :public_addresses
  attr_accessor :private_addresses
  attr_accessor :instance_profile
  attr_accessor :launch_time
  attr_accessor :keyname
  attr_accessor :authn_error

  def initialize(init=nil)
    super(init)
    self.actions = [] if self.actions.nil?
    self.public_addresses = [] if self.public_addresses.nil?
    self.private_addresses = [] if self.private_addresses.nil?
  end

  def method_missing(name, *args)
    if name =~ /is_(\w+)\?/
      return true if self.state.downcase.eql?($1)
    else
      raise NoMethodError
    end
  end

  def authn_feature_failed?
    return true unless authn_error.nil?
  end
 

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
steamcannon-deltacloud-core-0.1.1.3 lib/deltacloud/models/instance.rb
steamcannon-deltacloud-core-0.1.1.2 lib/deltacloud/models/instance.rb
steamcannon-deltacloud-core-0.1.1.1 lib/deltacloud/models/instance.rb
deltacloud-core-0.1.1 lib/deltacloud/models/instance.rb
deltacloud-core-0.1.0 lib/deltacloud/models/instance.rb