Class: FreeAgent::Timeslip

Inherits:
Entity
  • Object
show all
Defined in:
lib/free_agent.rb

Instance Attribute Summary

Attributes inherited from Entity

#attributes

Instance Method Summary collapse

Methods inherited from Entity

belongs_to, #destroy, has_many, #id, #reload, #save, #update, #url, xml_name

Constructor Details

#initialize(resource, attributes = {}) ⇒ Timeslip

Returns a new instance of Timeslip.



225
226
227
228
229
# File 'lib/free_agent.rb', line 225

def initialize(resource, attributes={})
  # need to convert /projects/123/timeslips/456 into /timeslips/456
  tweaked_resource = RestClient::Resource.new(resource.url.gsub(/\/projects\/\d+\//, "/"), resource.options)
  super(tweaked_resource, attributes)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class FreeAgent::Entity