8000 Clarify Owner#to_s and #to_h · lardieri/github-metadata@b64a6d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit b64a6d3

Browse files
committed
Clarify Owner#to_s and #to_h
1 parent 37f9a06 commit b64a6d3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/jekyll-github-metadata/owner.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,20 @@ def initialize(owner_login)
6464

6565
def to_h
6666
@to_h ||= self.class.content_methods
67-
.each_with_object({}) { |method, hash| hash[method] = public_send(method) }
67+
.each_with_object({}) { |method, hash| hash[method.to_s] = public_send(method) }
6868
end
6969
alias_method :to_hash, :to_h
7070
def_delegator :to_h, :to_json, :to_json
7171

72-
def_delegator :to_json, :to_s, :to_s
72+
def_delegator :to_h, :to_s, :to_s
7373
alias_method :to_str, :to_s
7474

7575
private
7676

7777
def owner_info
7878
@owner_info ||= begin
79-
Value.new("owner",
79+
Value.new(
80+
"owner",
8081
proc do |c|
8182
(c.organization(owner_login) || c.user(owner_login) || {}).to_h
8283
end

0 commit comments

Comments
 (0)
0