Class: Clubhouse::Member
Class Method Summary
collapse
Instance Method Summary
collapse
#api_url, #delete!, #flush, inherited, property_filter_create, property_filter_update, #resolve_to_ids, #set_properties, subclass, #to_h, #update, validate, #value_format
Constructor Details
#initialize(client:, object:) ⇒ Member
Returns a new instance of Member.
7
8
9
10
11
12
13
14
15
|
# File 'lib/clubhouse2/member.rb', line 7
def initialize(client:, object:)
super
@profile = Profile.new(client: client, object: @profile)
Profile.properties.each do |property|
self.class.send(:define_method, (property.to_sym)) { @profile.send(property) }
end
end
|
Class Method Details
.api_url ⇒ Object
17
18
19
|
# File 'lib/clubhouse2/member.rb', line 17
def self.api_url
'members'
end
|
.properties ⇒ Object
3
4
5
|
# File 'lib/clubhouse2/member.rb', line 3
def self.properties
[ :created_at, :disabled, :id, :profile, :role, :updated_at ]
end
|
Instance Method Details
#stories_following ⇒ Object
25
26
27
|
# File 'lib/clubhouse2/member.rb', line 25
def stories_following
@client.projects.collect(&:stories).reduce(:+).select { |s| s.follower_ids.include? @id }
end
|
#stories_requested ⇒ Object
21
22
23
|
# File 'lib/clubhouse2/member.rb', line 21
def stories_requested
@client.projects.collect(&:stories).reduce(:+).select { |s| s.requested_by_id == @id }
end
|