Class: Backlog::Object::CustomField

Inherits:
Object
  • Object
show all
Defined in:
lib/backlog/object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(custom_field) ⇒ CustomField

Returns a new instance of CustomField.



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/backlog/object.rb', line 182

def initialize(custom_field)
  @id = custom_field['id']
  @type_id = custom_field['type_id']
  @name = custom_field['name']
  @description = custom_field['description']
  @required = custom_field['required']
  if custom_field['issue_types']
    @issue_types = custom_field['issue_types'].map {|issue_type| IssueType.new(issue_type) }
  end
  # custom_field type is Number(type_id = 3)
  @min = custom_field['min']
  @max = custom_field['max']
  @initial_value = custom_field['initial_value']
  @unit = custom_field['unit']
  # custom_field type is Date(type_id = 4)
  @initial_value_type = custom_field['initial_value_type']
  @initial_shift = custom_field['initial_shift']
  @initial_date = custom_field['initial_date']
  # custom_field type is List(type_id = 5,6)
  if custom_field['items']
    @items = custom_field['items'].map {|item| Item.new(item)}
  end
  # custom_field type is CheckBox or RadioButton(type_id = 7,8)
  @allow_input = custom_field['allow_input']
end

Instance Attribute Details

#allow_inputObject (readonly)

Returns the value of attribute allow_input.



207
208
209
# File 'lib/backlog/object.rb', line 207

def allow_input
  @allow_input
end

#descriptionObject (readonly)

Returns the value of attribute description.



207
208
209
# File 'lib/backlog/object.rb', line 207

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



207
208
209
# File 'lib/backlog/object.rb', line 207

def id
  @id
end

#initial_dateObject (readonly)

Returns the value of attribute initial_date.



207
208
209
# File 'lib/backlog/object.rb', line 207

def initial_date
  @initial_date
end

#initial_shiftObject (readonly)

Returns the value of attribute initial_shift.



207
208
209
# File 'lib/backlog/object.rb', line 207

def initial_shift
  @initial_shift
end

#initial_valueObject (readonly)

Returns the value of attribute initial_value.



207
208
209
# File 'lib/backlog/object.rb', line 207

def initial_value
  @initial_value
end

#initial_value_typeObject (readonly)

Returns the value of attribute initial_value_type.



207
208
209
# File 'lib/backlog/object.rb', line 207

def initial_value_type
  @initial_value_type
end

#issue_typesObject (readonly)

Returns the value of attribute issue_types.



207
208
209
# File 'lib/backlog/object.rb', line 207

def issue_types
  @issue_types
end

#itemsObject (readonly)

Returns the value of attribute items.



207
208
209
# File 'lib/backlog/object.rb', line 207

def items
  @items
end

#maxObject (readonly)

Returns the value of attribute max.



207
208
209
# File 'lib/backlog/object.rb', line 207

def max
  @max
end

#minObject (readonly)

Returns the value of attribute min.



207
208
209
# File 'lib/backlog/object.rb', line 207

def min
  @min
end

#nameObject (readonly)

Returns the value of attribute name.



207
208
209
# File 'lib/backlog/object.rb', line 207

def name
  @name
end

#requiredObject (readonly)

Returns the value of attribute required.



207
208
209
# File 'lib/backlog/object.rb', line 207

def required
  @required
end

#type_idObject (readonly)

Returns the value of attribute type_id.



207
208
209
# File 'lib/backlog/object.rb', line 207

def type_id
  @type_id
end

#unitObject (readonly)

Returns the value of attribute unit.



207
208
209
# File 'lib/backlog/object.rb', line 207

def unit
  @unit
end