Class: Hubhumans::Humanifier
- Inherits:
-
Object
- Object
- Hubhumans::Humanifier
- Defined in:
- lib/hubhumans.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize ⇒ Humanifier
constructor
A new instance of Humanifier.
- #render_for_org(org_name) ⇒ Object
- #render_user(login) ⇒ Object
Constructor Details
#initialize ⇒ Humanifier
Returns a new instance of Humanifier.
9 10 11 |
# File 'lib/hubhumans.rb', line 9 def initialize @client = Octokit::Client.new(:auto_traversal => true) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
7 8 9 |
# File 'lib/hubhumans.rb', line 7 def client @client end |
Instance Method Details
#render_for_org(org_name) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/hubhumans.rb', line 13 def render_for_org(org_name) gh_org = @client.organization_members(org_name) output = "/* TEAM */\n" gh_org.each do |member| output << self.render_user(member.login) end output end |
#render_user(login) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/hubhumans.rb', line 22 def render_user(login) user = @client.user(login) output = "" output << " #{format_name(user.name,user.login)}\n" output << " Site: #{user.blog}\n" unless user.blog.nil? output << " Location: #{user.location}\n" unless user.location.nil? output + "\n" end |