Class: PostProxy::PostStats

Inherits:
Model
  • Object
show all
Defined in:
lib/postproxy/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#to_h

Constructor Details

#initialize(**attrs) ⇒ PostStats

Returns a new instance of PostStats.



217
218
219
220
221
222
223
# File 'lib/postproxy/types.rb', line 217

def initialize(**attrs)
  @platforms = []
  super
  @platforms = (@platforms || []).map do |p|
    p.is_a?(PlatformStats) ? p : PlatformStats.new(**p.transform_keys(&:to_sym))
  end
end

Instance Attribute Details

#platformsObject

Returns the value of attribute platforms.



215
216
217
# File 'lib/postproxy/types.rb', line 215

def platforms
  @platforms
end