You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2010/12/08 13:34:23 UTC
[PATCH core 2/4] Added Address model
From: Michal Fojtik <mf...@redhat.com>
---
server/deltacloud.rb | 1 +
server/lib/deltacloud/models/address.rb | 32 +++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 0 deletions(-)
create mode 100644 server/lib/deltacloud/models/address.rb
diff --git a/server/deltacloud.rb b/server/deltacloud.rb
index 516963e..bbea513 100644
--- a/server/deltacloud.rb
+++ b/server/deltacloud.rb
@@ -35,6 +35,7 @@ require 'deltacloud/models/storage_volume'
require 'deltacloud/models/bucket'
require 'deltacloud/models/blob'
require 'deltacloud/models/load_balancer'
+require 'deltacloud/models/address'
require 'deltacloud/validation'
require 'deltacloud/helpers'
diff --git a/server/lib/deltacloud/models/address.rb b/server/lib/deltacloud/models/address.rb
new file mode 100644
index 0000000..a3fc932
--- /dev/null
+++ b/server/lib/deltacloud/models/address.rb
@@ -0,0 +1,32 @@
+#
+# Copyright (C) 2009, 2010 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 Address < BaseModel
+
+ attr_accessor :instance_id
+ attr_accessor :visibility
+
+ def initialize(init=nil)
+ super(init)
+ end
+
+ def is_public?
+ self.visibility.eql?(:public)
+ end
+
+end
--
1.7.3.2