Class: Pandoru::Models::StationFeedback

Inherits:
Base
  • Object
show all
Defined in:
lib/pandoru/models/station.rb

Overview

A station’s feedback (thumbs) returned under the “feedback” key of an extended getStation response.

Instance Attribute Summary collapse

Attributes inherited from Base

#data

Class Method Summary collapse

Methods inherited from Base

date_field, field, fields, from_json_list, #initialize, #inspect, #populate_from_json, #to_h

Constructor Details

This class inherits a constructor from Pandoru::Models::Base

Instance Attribute Details

#thumbs_downObject

Returns the value of attribute thumbs_down.



77
78
79
# File 'lib/pandoru/models/station.rb', line 77

def thumbs_down
  @thumbs_down
end

#thumbs_upObject

Returns the value of attribute thumbs_up.



77
78
79
# File 'lib/pandoru/models/station.rb', line 77

def thumbs_up
  @thumbs_up
end

Class Method Details

.from_json(api_client, data) ⇒ Object



81
82
83
84
85
86
87
88
# File 'lib/pandoru/models/station.rb', line 81

def self.from_json(api_client, data)
  return nil unless data
  instance = new(data, api_client)
  instance.populate_from_json(data)
  instance.thumbs_up   = SongFeedback.from_json_list(api_client, data['thumbsUp'])
  instance.thumbs_down = SongFeedback.from_json_list(api_client, data['thumbsDown'])
  instance
end