-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5296b4d
commit 19fb582
Showing
4 changed files
with
265 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,41 @@ | ||
class Repo::Owner | ||
property resolver : String | ||
property slug : String | ||
property name : String? | ||
property description : String? | ||
property extra : Hash(String, JSON::Any) | ||
property shards_count : Int32? | ||
property! id : Int64 | ||
class Repo | ||
class Owner | ||
property resolver : String | ||
property slug : String | ||
property name : String? | ||
property description : String? | ||
property extra : Hash(String, JSON::Any) | ||
property shards_count : Int32? | ||
property! id : Int64 | ||
|
||
def initialize(@resolver : String, @slug : String, | ||
@name : String? = nil, @description : String? = nil, | ||
@extra : Hash(String, JSON::Any) = Hash(String, JSON::Any).new, | ||
@shards_count : Int32? = nil, | ||
*, @id : Int64? = nil) | ||
end | ||
def initialize(@resolver : String, @slug : String, | ||
@name : String? = nil, @description : String? = nil, | ||
@extra : Hash(String, JSON::Any) = Hash(String, JSON::Any).new, | ||
@shards_count : Int32? = nil, | ||
*, @id : Int64? = nil) | ||
end | ||
|
||
def self.from_repo_ref(repo_ref : Ref) : Owner? | ||
if owner = repo_ref.owner | ||
new(repo_ref.resolver, owner) | ||
def self.from_repo_ref(repo_ref : Ref) : Owner? | ||
if owner = repo_ref.owner | ||
new(repo_ref.resolver, owner) | ||
end | ||
end | ||
end | ||
|
||
def_equals_and_hash @resolver, @slug, @name, @description, @extra, @shards_count | ||
def_equals_and_hash @resolver, @slug, @name, @description, @extra, @shards_count | ||
|
||
def website_url : String? | ||
extra["website_url"]?.try(&.as_s?) | ||
end | ||
def website_url : String? | ||
extra["website_url"]?.try(&.as_s?) | ||
end | ||
|
||
record Metrics, | ||
shards_count : Int32, | ||
dependents_count : Int32, | ||
transitive_dependents_count : Int32, | ||
dev_dependents_count : Int32, | ||
transitive_dependencies_count : Int32, | ||
dev_dependencies_count : Int32, | ||
dependencies_count : Int32, | ||
popularity : Float32, | ||
created_at : Time? = nil | ||
record Metrics, | ||
shards_count : Int32, | ||
dependents_count : Int32, | ||
transitive_dependents_count : Int32, | ||
dev_dependents_count : Int32, | ||
transitive_dependencies_count : Int32, | ||
dev_dependencies_count : Int32, | ||
dependencies_count : Int32, | ||
popularity : Float32, | ||
created_at : Time? = nil | ||
end | ||
end |
Oops, something went wrong.