Class: ActiveBugzilla::Flag

Inherits:
Base
  • Object
show all
Defined in:
lib/active_bugzilla/flag.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

service, service=

Constructor Details

#initialize(attributes) ⇒ Flag

Returns a new instance of Flag.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/active_bugzilla/flag.rb', line 6

def initialize(attributes)
  @id         = attributes['id']
  @bug_id     = attributes['bug_id']
  @type_id    = attributes['type_id']
  @created_on = normalize_timestamp(attributes['creation_date'])
  @updated_on = normalize_timestamp(attributes['modification_date'])
  @status     = attributes['status']
  @name       = attributes['name']
  @setter     = attributes['setter']
  @active     = attributes['is_active']
end

Instance Attribute Details

#activeObject (readonly) Also known as: active?

Returns the value of attribute active.



3
4
5
# File 'lib/active_bugzilla/flag.rb', line 3

def active
  @active
end

#bug_idObject (readonly)

Returns the value of attribute bug_id.



3
4
5
# File 'lib/active_bugzilla/flag.rb', line 3

def bug_id
  @bug_id
end

#created_onObject (readonly)

Returns the value of attribute created_on.



3
4
5
# File 'lib/active_bugzilla/flag.rb', line 3

def created_on
  @created_on
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/active_bugzilla/flag.rb', line 3

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/active_bugzilla/flag.rb', line 3

def name
  @name
end

#setterObject (readonly)

Returns the value of attribute setter.



3
4
5
# File 'lib/active_bugzilla/flag.rb', line 3

def setter
  @setter
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/active_bugzilla/flag.rb', line 3

def status
  @status
end

#type_idObject (readonly)

Returns the value of attribute type_id.



3
4
5
# File 'lib/active_bugzilla/flag.rb', line 3

def type_id
  @type_id
end

#updated_onObject (readonly)

Returns the value of attribute updated_on.



3
4
5
# File 'lib/active_bugzilla/flag.rb', line 3

def updated_on
  @updated_on
end

Class Method Details

.instantiate_from_raw_data(data, bug_id = nil) ⇒ Object



18
19
20
# File 'lib/active_bugzilla/flag.rb', line 18

def self.instantiate_from_raw_data(data, bug_id = nil)
  data.collect { |hash| new(hash.merge('bug_id' => bug_id)) }
end