Class: Smite::RecommendedItems
- Defined in:
- lib/smite/recommended_items.rb
Instance Attribute Summary collapse
-
#god_name ⇒ Object
readonly
Returns the value of attribute god_name.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Attributes inherited from Object
Instance Method Summary collapse
-
#initialize(god_name, data, role) ⇒ RecommendedItems
constructor
A new instance of RecommendedItems.
- #inspect ⇒ Object
Methods inherited from Object
Constructor Details
#initialize(god_name, data, role) ⇒ RecommendedItems
Returns a new instance of RecommendedItems.
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/smite/recommended_items.rb', line 4 def initialize(god_name, data, role) @god_name = god_name @role = role.downcase new_data = {} data.each do |rec| next unless rec['Role'].downcase == @role new_data[rec['Category']] ||= [] new_data[rec['Category']] << Smite::Game.device(rec['item_id']) end super(new_data) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Smite::Object
Instance Attribute Details
#god_name ⇒ Object (readonly)
Returns the value of attribute god_name.
3 4 5 |
# File 'lib/smite/recommended_items.rb', line 3 def god_name @god_name end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
3 4 5 |
# File 'lib/smite/recommended_items.rb', line 3 def role @role end |
Instance Method Details
#inspect ⇒ Object
18 19 20 |
# File 'lib/smite/recommended_items.rb', line 18 def inspect "#<Smite::RecommendedItems '#{god_name}' Role: '#{role}'>" end |