Class: Clubhouse::Project
Class Method Summary
collapse
Instance Method Summary
collapse
#api_url, #delete!, #flush, inherited, #initialize, property_filter_create, property_filter_update, #resolve_to_ids, #set_properties, subclass, #to_h, #update, validate, #value_format
Class Method Details
.api_url ⇒ Object
10
11
12
|
# File 'lib/clubhouse2/project.rb', line 10
def self.api_url
'projects'
end
|
.properties ⇒ Object
3
4
5
6
7
8
|
# File 'lib/clubhouse2/project.rb', line 3
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
|
Instance Method Details
#create_story(**args) ⇒ Object
19
20
21
22
23
24
|
# File 'lib/clubhouse2/project.rb', line 19
def create_story(**args)
@stories = nil
args[:project_id] = @id
Story.validate(**args)
@client.create_object(:story, args)
end
|
#stories(**args) ⇒ Object
14
15
16
17
|
# File 'lib/clubhouse2/project.rb', line 14
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
|
#story(**args) ⇒ Object
26
|
# File 'lib/clubhouse2/project.rb', line 26
def story(**args); stories(args).first; end
|