lib/tracker_api/resources/project.rb in tracker_api-0.2.10 vs lib/tracker_api/resources/project.rb in tracker_api-0.2.11

- old
+ new

@@ -1,13 +1,13 @@ module TrackerApi module Resources class Project - include Resources::Base + include Shared::HasId attribute :client - attribute :account, TrackerApi::Resources::Account + attribute :account, Account attribute :account_id, Integer attribute :atom_enabled, Boolean attribute :bugs_and_chores_are_estimatable, Boolean attribute :created_at, DateTime attribute :current_iteration_number, Integer @@ -16,26 +16,26 @@ attribute :enable_following, Boolean attribute :enable_incoming_emails, Boolean attribute :enable_planned_mode, Boolean attribute :enable_tasks, Boolean attribute :epic_ids, Array[Integer] - attribute :epics, Array[TrackerApi::Resources::Epic] + attribute :epics, Array[Epic] attribute :has_google_domain, Boolean attribute :initial_velocity, Integer attribute :iteration_length, Integer attribute :kind, String attribute :label_ids, Array[Integer] - attribute :labels, Array[TrackerApi::Resources::Label] + attribute :labels, Array[Label] attribute :name, String attribute :number_of_done_iterations_to_show, Integer attribute :point_scale, String attribute :point_scale_is_custom, Boolean attribute :profile_content, String attribute :public, Boolean attribute :start_date, DateTime attribute :start_time, DateTime - attribute :time_zone, TrackerApi::Resources::TimeZone + attribute :time_zone, TimeZone attribute :updated_at, DateTime attribute :velocity_averaged_over, Integer attribute :version, Integer attribute :week_start_day, String @@ -145,9 +145,25 @@ # # @param [Hash] params attributes to create the story with # @return [Story] newly created Story def create_story(params) Endpoints::Story.new(client).create(id, params) + end + + # Find a epic by id for the project. + # + # @param [Fixnum] epic_id id of epic to get + # @return [Epic] epic with given id + def epic(epic_id, params={}) + Endpoints::Epic.new(client).get(id, epic_id, params) + end + + # Create a new epic in the project. + # + # @param [Hash] params attributes to create the epic with + # @return [epic] newly created Epic + def create_epic(params) + Endpoints::Epic.new(client).create(id, params) end # Add a new membership for the project. # # @param [Hash] params attributes to add a member; must have at least email or user_id