Class: OpenShift::Connector

Inherits:
Model
  • Object
show all
Defined in:
lib/openshift-origin-common/models/connector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

attr_accessor, attr_reader, attr_writer, #attributes, #attributes=, #deleted?, exclude_attributes, excludes_attributes, gen_uuid, include_attributes, includes_attributes, #new_record?, #persisted?, primary_key, require_update_attributes, requires_update_attributes, #reset_state, #to_xml

Constructor Details

#initialize(name = nil) ⇒ Connector

Returns a new instance of Connector.



5
6
7
# File 'lib/openshift-origin-common/models/connector.rb', line 5

def initialize(name=nil)
  self.name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/openshift-origin-common/models/connector.rb', line 3

def name
  @name
end

#requiredObject

Returns the value of attribute required.



3
4
5
# File 'lib/openshift-origin-common/models/connector.rb', line 3

def required
  @required
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/openshift-origin-common/models/connector.rb', line 3

def type
  @type
end

Instance Method Details

#from_descriptor(spec_hash = {}) ⇒ Object



9
10
11
12
13
# File 'lib/openshift-origin-common/models/connector.rb', line 9

def from_descriptor(spec_hash = {})
  self.type = spec_hash["Type"]
  self.required = spec_hash["Required"].to_s.downcase == "true" || false
  self
end

#to_descriptorObject



15
16
17
18
19
20
# File 'lib/openshift-origin-common/models/connector.rb', line 15

def to_descriptor
  {
    "Type" => self.type,
    "Required" => self.required
  }
end