class ActiveBugzilla::Field
Constants
- FIELD_ALIASES
List of field aliases. Maps old style RHBZ parameter names to actual upstream values. Used for createbug() and query include_fields at least.
- KNOWN_TIMESTAMPS
Attributes
custom?[R]
display_name[R]
id[R]
is_custom[R]
is_mandatory[R]
is_on_bug_entry[R]
mandatory?[R]
name[R]
on_bug_entry?[R]
original_name[R]
type[R]
values[R]
visibility_field[R]
visibility_values[R]
Public Class Methods
instantiate_from_raw_data(data)
click to toggle source
# File lib/active_bugzilla/field.rb, line 54 def self.instantiate_from_raw_data(data) data.delete_if { |hash| hash["name"] == "longdesc" } # Another way to specify comment[0] data.delete_if { |hash| hash["name"].include?(".") } # Remove things like longdescs.count data.collect do |field_hash| new(field_hash) end end
new(attributes = {})
click to toggle source
# File lib/active_bugzilla/field.rb, line 36 def initialize(attributes = {}) @display_name = attributes["display_name"] @id = attributes["id"] @name = self.class.field_alias(attributes["name"]) @original_name = attributes["name"] @type = attributes["type"] @values = attributes["values"] @visibility_field = attributes["visibility_field"] @visibility_values = attributes["visibility_values"] @is_custom = attributes["is_custom"] @is_mandatory = attributes["is_mandatory"] @is_on_bug_entry = attributes["is_on_bug_entry"] end
Private Class Methods
field_alias(value)
click to toggle source
# File lib/active_bugzilla/field.rb, line 64 def self.field_alias(value) FIELD_ALIASES[value] || value end
Public Instance Methods
timestamp?()
click to toggle source
# File lib/active_bugzilla/field.rb, line 50 def timestamp? (type == 5) || KNOWN_TIMESTAMPS.include?(name) end