Class: Houston::Adapters::TicketTracker::UnfuddleAdapter::Milestone

Inherits:
Object
  • Object
show all
Defined in:
app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/milestone.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, attributes) ⇒ Milestone

Returns a new instance of Milestone.



8
9
10
11
12
13
# File 'app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/milestone.rb', line 8

def initialize(connection, attributes)
  @connection       = connection
  @raw_attributes   = attributes
  @remote_id        = attributes["id"]
  @name             = attributes["title"]
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



15
16
17
# File 'app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/milestone.rb', line 15

def name
  @name
end

#raw_attributesObject (readonly)

Returns the value of attribute raw_attributes.



15
16
17
# File 'app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/milestone.rb', line 15

def raw_attributes
  @raw_attributes
end

#remote_idObject (readonly)

Returns the value of attribute remote_id.



15
16
17
# File 'app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/milestone.rb', line 15

def remote_id
  @remote_id
end

Instance Method Details

#attributesObject



19
20
21
22
# File 'app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/milestone.rb', line 19

def attributes
  { remote_id:      remote_id,
    name:           name }
end

#update_name!(name) ⇒ Object



25
26
27
28
29
30
# File 'app/adapters/houston/adapters/ticket_tracker/unfuddle_adapter/milestone.rb', line 25

def update_name!(name)
  Houston.benchmark title: "Update Unfuddle Milestone" do
    milestone = ::Unfuddle::Milestone.new(raw_attributes)
    milestone.update_attribute("title", name)
  end
end