Class: XapiScraper::Models::Components::MediaModel

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Crystalline::MetadataFields
Defined in:
lib/xapi_scraper/models/components/mediamodel.rb

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

#field, #fields, included, #marshal_single, #to_dict, #to_json

Constructor Details

#initialize(id:, type:, streams: nil, display_url: nil, expanded_url: nil, media_url: nil, url: nil, height: nil, width: nil, features: nil, original_info: nil, sizes: nil, source_status_id: nil, source_user_id: nil, duration_millis: nil, aspect_ratio: nil, video_info: nil) ⇒ MediaModel

Returns a new instance of MediaModel.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/xapi_scraper/models/components/mediamodel.rb', line 131

def initialize(
  id:,
  type:,
  streams: nil,
  display_url: nil,
  expanded_url: nil,
  media_url: nil,
  url: nil,
  height: nil,
  width: nil,
  features: nil,
  original_info: nil,
  sizes: nil,
  source_status_id: nil,
  source_user_id: nil,
  duration_millis: nil,
  aspect_ratio: nil,
  video_info: nil
)
  @id = id
  @type = type
  @streams = streams
  @display_url = display_url
  @expanded_url = expanded_url
  @media_url = media_url
  @url = url
  @height = height
  @width = width
  @features = features
  @original_info = original_info
  @sizes = sizes
  @source_status_id = source_status_id
  @source_user_id = source_user_id
  @duration_millis = duration_millis
  @aspect_ratio = aspect_ratio
  @video_info = video_info
end

Instance Method Details

#==(other) ⇒ Object



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/xapi_scraper/models/components/mediamodel.rb', line 170

def ==(other)
  return false unless other.is_a?(self.class)
  return false unless @id == other.id
  return false unless @type == other.type
  return false unless @streams == other.streams
  return false unless @display_url == other.display_url
  return false unless @expanded_url == other.expanded_url
  return false unless @media_url == other.media_url
  return false unless @url == other.url
  return false unless @height == other.height
  return false unless @width == other.width
  return false unless @features == other.features
  return false unless @original_info == other.original_info
  return false unless @sizes == other.sizes
  return false unless @source_status_id == other.source_status_id
  return false unless @source_user_id == other.source_user_id
  return false unless @duration_millis == other.duration_millis
  return false unless @aspect_ratio == other.aspect_ratio
  return false unless @video_info == other.video_info
  true
end