Sha256: 6bf032ec5c642a5ea35f8a5ad9823a11dd2ae3f288d89e650d616bc4d3768051

Contents?: true

Size: 803 Bytes

Versions: 10

Compression:

Stored size: 803 Bytes

Contents

module Clubhouse
	class Project < ClubhouseResource
		def self.properties
			[
				:abbreviation, :archived, :color, :created_at, :days_to_thermometer, :description, :entity_type, :external_id,
				:follower_ids, :id, :iteration_length, :name, :show_thermometer, :start_time, :stats, :updated_at
			]
		end

		def self.api_url
			'projects'
		end

		def stories(**args)
			@stories ||= JSON.parse(@client.api_request(:get, @client.url("#{api_url}/stories"))).collect { |story| Story.new(client: @client, object: story) }
			@stories.reject { |s| args.collect { |k,v| s.send(k) != v }.reduce(:|) }
		end

		def create_story(**args)
			@stories = nil
			args[:project_id] = @id
			Story.validate(**args)
			@client.create_object(:story, args)
		end

		def story(**args); stories(args).first; end
	end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
clubhouse2-1.0.11 lib/clubhouse2/project.rb
clubhouse2-1.0.10 lib/clubhouse2/project.rb
clubhouse2-1.0.8 lib/clubhouse2/project.rb
clubhouse2-1.0.7 lib/clubhouse2/project.rb
clubhouse2-1.0.6 lib/clubhouse2/project.rb
clubhouse2-1.0.5 lib/clubhouse2/project.rb
clubhouse2-1.0.4 lib/clubhouse2/project.rb
clubhouse2-1.0.3 lib/clubhouse2/project.rb
clubhouse2-0.0.2 lib/clubhouse2/project.rb
clubhouse2-0.0.1 lib/clubhouse2/project.rb