Class: CtdDocumentation::Task
- Defined in:
- lib/ctd_documentation/models/task.rb
Overview
Task Model.
Instance Attribute Summary collapse
-
#active_type ⇒ Integer
Indicating 1 for query and 2 for task.
-
#allowed_days ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#allowed_run_time_end ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#allowed_run_time_start ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#assets_count ⇒ Integer
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#enabled ⇒ TrueClass|FalseClass
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#end_time ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#extra_params ⇒ Taskextraparams
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#id ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#interval ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#is_recurring ⇒ TrueClass|FalseClass
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#last_start_run_time ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#name ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#network_id ⇒ Integer
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#resource_id ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#site_id ⇒ Float
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#start_time ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#status ⇒ String
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#type ⇒ Integer
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
-
#valid ⇒ TrueClass|FalseClass
A string that represents specific days in a week, Sunday being 0 and Friday being 6.
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
Methods inherited from BaseModel
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, assets_count = SKIP, extra_params = SKIP, enabled = SKIP, id = SKIP, last_start_run_time = SKIP, network_id = SKIP, active_type = SKIP) ⇒ Task
Returns a new instance of Task.
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/ctd_documentation/models/task.rb', line 187 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, assets_count = SKIP, extra_params = SKIP, enabled = SKIP, id = SKIP, last_start_run_time = SKIP, network_id = SKIP, active_type = 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 @assets_count = assets_count unless assets_count == SKIP @extra_params = extra_params unless extra_params == SKIP @enabled = enabled unless enabled == SKIP @id = id unless id == SKIP @last_start_run_time = last_start_run_time unless last_start_run_time == SKIP @network_id = network_id unless network_id == SKIP @active_type = active_type unless active_type == SKIP end |
Instance Attribute Details
#active_type ⇒ Integer
Indicating 1 for query and 2 for task
128 129 130 |
# File 'lib/ctd_documentation/models/task.rb', line 128 def active_type @active_type end |
#allowed_days ⇒ String
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
16 17 18 |
# File 'lib/ctd_documentation/models/task.rb', line 16 def allowed_days @allowed_days end |
#allowed_run_time_end ⇒ String
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
22 23 24 |
# File 'lib/ctd_documentation/models/task.rb', line 22 def allowed_run_time_end @allowed_run_time_end end |
#allowed_run_time_start ⇒ String
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
28 29 30 |
# File 'lib/ctd_documentation/models/task.rb', line 28 def allowed_run_time_start @allowed_run_time_start end |
#assets_count ⇒ Integer
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
94 95 96 |
# File 'lib/ctd_documentation/models/task.rb', line 94 def assets_count @assets_count end |
#enabled ⇒ TrueClass|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
106 107 108 |
# File 'lib/ctd_documentation/models/task.rb', line 106 def enabled @enabled end |
#end_time ⇒ String
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
40 41 42 |
# File 'lib/ctd_documentation/models/task.rb', line 40 def end_time @end_time end |
#extra_params ⇒ Taskextraparams
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
100 101 102 |
# File 'lib/ctd_documentation/models/task.rb', line 100 def extra_params @extra_params end |
#id ⇒ String
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
112 113 114 |
# File 'lib/ctd_documentation/models/task.rb', line 112 def id @id end |
#interval ⇒ String
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
46 47 48 |
# File 'lib/ctd_documentation/models/task.rb', line 46 def interval @interval end |
#is_recurring ⇒ TrueClass|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
52 53 54 |
# File 'lib/ctd_documentation/models/task.rb', line 52 def is_recurring @is_recurring end |
#last_start_run_time ⇒ String
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
118 119 120 |
# File 'lib/ctd_documentation/models/task.rb', line 118 def last_start_run_time @last_start_run_time end |
#name ⇒ String
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
58 59 60 |
# File 'lib/ctd_documentation/models/task.rb', line 58 def name @name end |
#network_id ⇒ Integer
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
124 125 126 |
# File 'lib/ctd_documentation/models/task.rb', line 124 def network_id @network_id end |
#resource_id ⇒ String
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
64 65 66 |
# File 'lib/ctd_documentation/models/task.rb', line 64 def resource_id @resource_id end |
#site_id ⇒ Float
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
70 71 72 |
# File 'lib/ctd_documentation/models/task.rb', line 70 def site_id @site_id end |
#start_time ⇒ String
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
88 89 90 |
# File 'lib/ctd_documentation/models/task.rb', line 88 def start_time @start_time end |
#status ⇒ String
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
76 77 78 |
# File 'lib/ctd_documentation/models/task.rb', line 76 def status @status end |
#type ⇒ Integer
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
34 35 36 |
# File 'lib/ctd_documentation/models/task.rb', line 34 def type @type end |
#valid ⇒ TrueClass|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
82 83 84 |
# File 'lib/ctd_documentation/models/task.rb', line 82 def valid @valid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/ctd_documentation/models/task.rb', line 230 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 assets_count = hash.key?('assets_count') ? hash['assets_count'] : SKIP extra_params = Taskextraparams.from_hash(hash['extra_params']) if hash['extra_params'] enabled = hash.key?('enabled') ? hash['enabled'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP last_start_run_time = hash.key?('last_start_run_time') ? hash['last_start_run_time'] : SKIP network_id = hash.key?('network_id') ? hash['network_id'] : SKIP active_type = hash.key?('active_type') ? hash['active_type'] : SKIP # Create object from extracted values. Task.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, assets_count, extra_params, enabled, id, last_start_run_time, network_id, active_type) end |
.names ⇒ Object
A mapping from model property names to API property names.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/ctd_documentation/models/task.rb', line 131 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['assets_count'] = 'assets_count' @_hash['extra_params'] = 'extra_params' @_hash['enabled'] = 'enabled' @_hash['id'] = 'id' @_hash['last_start_run_time'] = 'last_start_run_time' @_hash['network_id'] = 'network_id' @_hash['active_type'] = 'active_type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
183 184 185 |
# File 'lib/ctd_documentation/models/task.rb', line 183 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/ctd_documentation/models/task.rb', line 157 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 assets_count extra_params enabled id last_start_run_time network_id active_type ] end |