Class: Rafflesia::RepositoryListData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/repositories/repository_list_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  data: :data,
  has_more: :has_more,
  object: :object
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ RepositoryListData

Returns a new instance of RepositoryListData.



19
20
21
22
23
24
25
# File 'lib/rafflesia/repositories/repository_list_data.rb', line 19

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @data = (hash[:data] || []).map { |item| item ? Rafflesia::RepositorySummary.new(item) : nil }
  @has_more = hash[:has_more]
  @object = hash[:object]
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



14
15
16
# File 'lib/rafflesia/repositories/repository_list_data.rb', line 14

def data
  @data
end

#has_moreObject

Returns the value of attribute has_more.



14
15
16
# File 'lib/rafflesia/repositories/repository_list_data.rb', line 14

def has_more
  @has_more
end

#objectObject

Returns the value of attribute object.



14
15
16
# File 'lib/rafflesia/repositories/repository_list_data.rb', line 14

def object
  @object
end