Class: WhenIWork::Position
- Inherits:
-
Object
- Object
- WhenIWork::Position
- Includes:
- Response
- Defined in:
- lib/wheniwork-ruby/models/position.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sort ⇒ Object
Returns the value of attribute sort.
Attributes included from Response
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Position
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods included from Response
#_deserialize, #_to_hash, #build_from_hash, #eql?, #to_body, #to_hash, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ Position
Initializes the object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/wheniwork-ruby/models/position.rb', line 55 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'color') self.color = attributes[:'color'] end if attributes.has_key?(:'sort') self.sort = attributes[:'sort'] end end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
30 31 32 |
# File 'lib/wheniwork-ruby/models/position.rb', line 30 def color @color end |
#id ⇒ Object
Returns the value of attribute id.
28 29 30 |
# File 'lib/wheniwork-ruby/models/position.rb', line 28 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
29 30 31 |
# File 'lib/wheniwork-ruby/models/position.rb', line 29 def name @name end |
#sort ⇒ Object
Returns the value of attribute sort.
31 32 33 |
# File 'lib/wheniwork-ruby/models/position.rb', line 31 def sort @sort end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
34 35 36 37 38 39 40 41 |
# File 'lib/wheniwork-ruby/models/position.rb', line 34 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'color' => :'color', :'sort' => :'sort' } end |
.swagger_types ⇒ Object
Attribute type mapping.
44 45 46 47 48 49 50 51 |
# File 'lib/wheniwork-ruby/models/position.rb', line 44 def self.swagger_types { :'id' => :'Integer', :'name' => :'String', :'color' => :'String', :'sort' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
93 94 95 96 97 98 99 100 |
# File 'lib/wheniwork-ruby/models/position.rb', line 93 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && color == o.color && sort == o.sort end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
104 105 106 |
# File 'lib/wheniwork-ruby/models/position.rb', line 104 def hash [id, name, color, sort].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
81 82 83 84 |
# File 'lib/wheniwork-ruby/models/position.rb', line 81 def list_invalid_properties invalid_properties = Array.new return invalid_properties end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
88 89 |
# File 'lib/wheniwork-ruby/models/position.rb', line 88 def valid? end |