Class: OpenShift::Connector
- Defined in:
- lib/openshift-origin-common/models/connector.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#required ⇒ Object
Returns the value of attribute required.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #from_descriptor(spec_hash = {}) ⇒ Object
-
#initialize(name = nil) ⇒ Connector
constructor
A new instance of Connector.
- #to_descriptor ⇒ Object
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
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/openshift-origin-common/models/connector.rb', line 3 def name @name end |
#required ⇒ Object
Returns the value of attribute required.
3 4 5 |
# File 'lib/openshift-origin-common/models/connector.rb', line 3 def required @required end |
#type ⇒ Object
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_descriptor ⇒ Object
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 |