Class: MijDiscord::Data::SearchResults
- Inherits:
-
Object
- Object
- MijDiscord::Data::SearchResults
- Defined in:
- lib/mij-discord/data/server.rb
Defined Under Namespace
Classes: ResultData
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#total_count ⇒ Object
readonly
Returns the value of attribute total_count.
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ SearchResults
constructor
A new instance of SearchResults.
Constructor Details
#initialize(data, bot) ⇒ SearchResults
Returns a new instance of SearchResults.
413 414 415 416 417 418 419 420 421 |
# File 'lib/mij-discord/data/server.rb', line 413 def initialize(data, bot) @total_count = data['total_results'] = data['messages'].map do |group| context = group.map {|x| Message.new(x, bot) } result = context.delete_at(context.length / 2) ResultData.new(result, context) end end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
411 412 413 |
# File 'lib/mij-discord/data/server.rb', line 411 def end |
#total_count ⇒ Object (readonly)
Returns the value of attribute total_count.
409 410 411 |
# File 'lib/mij-discord/data/server.rb', line 409 def total_count @total_count end |