Class: CtdDocumentation::BaseTask

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/ctd_documentation/models/base_task.rb

Overview

BaseTask Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(allowed_days = SKIP, allowed_run_time_end = SKIP, allowed_run_time_start = SKIP, type = SKIP, end_time = SKIP, interval = SKIP, is_recurring = SKIP, name = SKIP, resource_id = SKIP, site_id = SKIP, status = SKIP, valid = SKIP, start_time = SKIP) ⇒ BaseTask

Returns a new instance of BaseTask.



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/ctd_documentation/models/base_task.rb', line 133

def initialize(allowed_days = SKIP,
               allowed_run_time_end = SKIP,
               allowed_run_time_start = SKIP,
               type = SKIP,
               end_time = SKIP,
               interval = SKIP,
               is_recurring = SKIP,
               name = SKIP,
               resource_id = SKIP,
               site_id = SKIP,
               status = SKIP,
               valid = SKIP,
               start_time = SKIP)
  @allowed_days = allowed_days unless allowed_days == SKIP
  @allowed_run_time_end = allowed_run_time_end unless allowed_run_time_end == SKIP
  @allowed_run_time_start = allowed_run_time_start unless allowed_run_time_start == SKIP
  @type = type unless type == SKIP
  @end_time = end_time unless end_time == SKIP
  @interval = interval unless interval == SKIP
  @is_recurring = is_recurring unless is_recurring == SKIP
  @name = name unless name == SKIP
  @resource_id = resource_id unless resource_id == SKIP
  @site_id = site_id unless site_id == SKIP
  @status = status unless status == SKIP
  @valid = valid unless valid == SKIP
  @start_time = start_time unless start_time == SKIP
end

Instance Attribute Details

#allowed_daysString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


16
17
18
# File 'lib/ctd_documentation/models/base_task.rb', line 16

def allowed_days
  @allowed_days
end

#allowed_run_time_endString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


22
23
24
# File 'lib/ctd_documentation/models/base_task.rb', line 22

def allowed_run_time_end
  @allowed_run_time_end
end

#allowed_run_time_startString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


28
29
30
# File 'lib/ctd_documentation/models/base_task.rb', line 28

def allowed_run_time_start
  @allowed_run_time_start
end

#end_timeString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


40
41
42
# File 'lib/ctd_documentation/models/base_task.rb', line 40

def end_time
  @end_time
end

#intervalString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


46
47
48
# File 'lib/ctd_documentation/models/base_task.rb', line 46

def interval
  @interval
end

#is_recurringTrueClass|FalseClass

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (TrueClass|FalseClass)


52
53
54
# File 'lib/ctd_documentation/models/base_task.rb', line 52

def is_recurring
  @is_recurring
end

#nameString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


58
59
60
# File 'lib/ctd_documentation/models/base_task.rb', line 58

def name
  @name
end

#resource_idString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


64
65
66
# File 'lib/ctd_documentation/models/base_task.rb', line 64

def resource_id
  @resource_id
end

#site_idFloat

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (Float)


70
71
72
# File 'lib/ctd_documentation/models/base_task.rb', line 70

def site_id
  @site_id
end

#start_timeString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


88
89
90
# File 'lib/ctd_documentation/models/base_task.rb', line 88

def start_time
  @start_time
end

#statusString

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (String)


76
77
78
# File 'lib/ctd_documentation/models/base_task.rb', line 76

def status
  @status
end

#typeInteger

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (Integer)


34
35
36
# File 'lib/ctd_documentation/models/base_task.rb', line 34

def type
  @type
end

#validTrueClass|FalseClass

A string that represents specific days in a week, Sunday being 0 and Friday being 6. To select more than a specific day just concatenate the day number to the string

Returns:

  • (TrueClass|FalseClass)


82
83
84
# File 'lib/ctd_documentation/models/base_task.rb', line 82

def valid
  @valid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/ctd_documentation/models/base_task.rb', line 162

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  allowed_days = hash.key?('allowed_days') ? hash['allowed_days'] : SKIP
  allowed_run_time_end =
    hash.key?('allowed_run_time_end') ? hash['allowed_run_time_end'] : SKIP
  allowed_run_time_start =
    hash.key?('allowed_run_time_start') ? hash['allowed_run_time_start'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  end_time = hash.key?('end_time') ? hash['end_time'] : SKIP
  interval = hash.key?('interval') ? hash['interval'] : SKIP
  is_recurring = hash.key?('is_recurring') ? hash['is_recurring'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  valid = hash.key?('valid') ? hash['valid'] : SKIP
  start_time = hash.key?('start_time') ? hash['start_time'] : SKIP

  # Create object from extracted values.

  BaseTask.new(allowed_days,
               allowed_run_time_end,
               allowed_run_time_start,
               type,
               end_time,
               interval,
               is_recurring,
               name,
               resource_id,
               site_id,
               status,
               valid,
               start_time)
end

.namesObject

A mapping from model property names to API property names.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/ctd_documentation/models/base_task.rb', line 91

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['allowed_days'] = 'allowed_days'
  @_hash['allowed_run_time_end'] = 'allowed_run_time_end'
  @_hash['allowed_run_time_start'] = 'allowed_run_time_start'
  @_hash['type'] = 'type'
  @_hash['end_time'] = 'end_time'
  @_hash['interval'] = 'interval'
  @_hash['is_recurring'] = 'is_recurring'
  @_hash['name'] = 'name'
  @_hash['resource_id'] = 'resource_id'
  @_hash['site_id'] = 'site_id'
  @_hash['status'] = 'status'
  @_hash['valid'] = 'valid'
  @_hash['start_time'] = 'start_time'
  @_hash
end

.nullablesObject

An array for nullable fields



129
130
131
# File 'lib/ctd_documentation/models/base_task.rb', line 129

def self.nullables
  []
end

.optionalsObject

An array for optional fields



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/ctd_documentation/models/base_task.rb', line 110

def self.optionals
  %w[
    allowed_days
    allowed_run_time_end
    allowed_run_time_start
    type
    end_time
    interval
    is_recurring
    name
    resource_id
    site_id
    status
    valid
    start_time
  ]
end