Class: Backlog::Object::CustomField
- Inherits:
-
Object
- Object
- Backlog::Object::CustomField
- Defined in:
- lib/backlog/object.rb
Instance Attribute Summary collapse
-
#allow_input ⇒ Object
readonly
Returns the value of attribute allow_input.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#initial_date ⇒ Object
readonly
Returns the value of attribute initial_date.
-
#initial_shift ⇒ Object
readonly
Returns the value of attribute initial_shift.
-
#initial_value ⇒ Object
readonly
Returns the value of attribute initial_value.
-
#initial_value_type ⇒ Object
readonly
Returns the value of attribute initial_value_type.
-
#issue_types ⇒ Object
readonly
Returns the value of attribute issue_types.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#type_id ⇒ Object
readonly
Returns the value of attribute type_id.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(custom_field) ⇒ CustomField
constructor
A new instance of CustomField.
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_input ⇒ Object (readonly)
Returns the value of attribute allow_input.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def allow_input @allow_input end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def id @id end |
#initial_date ⇒ Object (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_shift ⇒ Object (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_value ⇒ Object (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_type ⇒ Object (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_types ⇒ Object (readonly)
Returns the value of attribute issue_types.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def issue_types @issue_types end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def items @items end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def min @min end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def required @required end |
#type_id ⇒ Object (readonly)
Returns the value of attribute type_id.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def type_id @type_id end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
207 208 209 |
# File 'lib/backlog/object.rb', line 207 def unit @unit end |