Class: SpeakerdeckApi::Speaker
- Inherits:
-
Object
- Object
- SpeakerdeckApi::Speaker
- Defined in:
- lib/speakerdeck_api/speaker.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number_of_talks ⇒ Object
readonly
Returns the value of attribute number_of_talks.
-
#website ⇒ Object
readonly
Returns the value of attribute website.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Speaker
constructor
A new instance of Speaker.
Constructor Details
#initialize(params = {}) ⇒ Speaker
Returns a new instance of Speaker.
7 8 9 10 11 |
# File 'lib/speakerdeck_api/speaker.rb', line 7 def initialize(params = {}) @number_of_talks = params[:number_of_talks] || 0 @name = params[:name] || '' @website = params[:website] || '' end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/speakerdeck_api/speaker.rb', line 5 def name @name end |
#number_of_talks ⇒ Object (readonly)
Returns the value of attribute number_of_talks.
5 6 7 |
# File 'lib/speakerdeck_api/speaker.rb', line 5 def number_of_talks @number_of_talks end |
#website ⇒ Object (readonly)
Returns the value of attribute website.
5 6 7 |
# File 'lib/speakerdeck_api/speaker.rb', line 5 def website @website end |
Class Method Details
.get(speaker_name) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/speakerdeck_api/speaker.rb', line 13 def self.get(speaker_name) begin speaker_data = SpeakerdeckApi::Connection.new.get_speaker_data speaker_name speaker_details = SpeakerdeckApi::Parser.new.get_speaker_details speaker_data SpeakerdeckApi::Speaker.new speaker_details rescue raise SpeakerdeckApi::Exceptions::SpeakerNotFoundException end end |