Class: Asdawqw::CheckOut
- Defined in:
- lib/asdawqw/models/check_out.rb
Overview
CheckOut Model.
Instance Attribute Summary collapse
-
#friday ⇒ Boolean
Determines if check out could be made on friday.
-
#monday ⇒ Boolean
Determines if check out could be made on monday.
-
#saturday ⇒ Boolean
Determines if check out could be made on saturday.
-
#sunday ⇒ Boolean
Determines if check out could be made on sunday.
-
#thursday ⇒ Boolean
Determines if check out could be made on thursday.
-
#tuesday ⇒ Boolean
Determines if check out could be made on tuesday.
-
#wednesday ⇒ Boolean
Determines if check out could be made on wednesday.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(monday = nil, tuesday = nil, wednesday = nil, thursday = nil, friday = nil, saturday = nil, sunday = nil) ⇒ CheckOut
constructor
A new instance of CheckOut.
Methods inherited from BaseModel
Constructor Details
#initialize(monday = nil, tuesday = nil, wednesday = nil, thursday = nil, friday = nil, saturday = nil, sunday = nil) ⇒ CheckOut
Returns a new instance of CheckOut.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/asdawqw/models/check_out.rb', line 50 def initialize(monday = nil, tuesday = nil, wednesday = nil, thursday = nil, friday = nil, saturday = nil, sunday = nil) @monday = monday @tuesday = tuesday @wednesday = wednesday @thursday = thursday @friday = friday @saturday = saturday @sunday = sunday end |
Instance Attribute Details
#friday ⇒ Boolean
Determines if check out could be made on friday
27 28 29 |
# File 'lib/asdawqw/models/check_out.rb', line 27 def friday @friday end |
#monday ⇒ Boolean
Determines if check out could be made on monday
11 12 13 |
# File 'lib/asdawqw/models/check_out.rb', line 11 def monday @monday end |
#saturday ⇒ Boolean
Determines if check out could be made on saturday
31 32 33 |
# File 'lib/asdawqw/models/check_out.rb', line 31 def saturday @saturday end |
#sunday ⇒ Boolean
Determines if check out could be made on sunday
35 36 37 |
# File 'lib/asdawqw/models/check_out.rb', line 35 def sunday @sunday end |
#thursday ⇒ Boolean
Determines if check out could be made on thursday
23 24 25 |
# File 'lib/asdawqw/models/check_out.rb', line 23 def thursday @thursday end |
#tuesday ⇒ Boolean
Determines if check out could be made on tuesday
15 16 17 |
# File 'lib/asdawqw/models/check_out.rb', line 15 def tuesday @tuesday end |
#wednesday ⇒ Boolean
Determines if check out could be made on wednesday
19 20 21 |
# File 'lib/asdawqw/models/check_out.rb', line 19 def wednesday @wednesday end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/asdawqw/models/check_out.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. monday = hash['monday'] tuesday = hash['tuesday'] wednesday = hash['wednesday'] thursday = hash['thursday'] friday = hash['friday'] saturday = hash['saturday'] sunday = hash['sunday'] # Create object from extracted values. CheckOut.new(monday, tuesday, wednesday, thursday, friday, saturday, sunday) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/asdawqw/models/check_out.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['monday'] = 'monday' @_hash['tuesday'] = 'tuesday' @_hash['wednesday'] = 'wednesday' @_hash['thursday'] = 'thursday' @_hash['friday'] = 'friday' @_hash['saturday'] = 'saturday' @_hash['sunday'] = 'sunday' @_hash end |