Module: Unchained::Client::Mixins::Resource
- Included in:
- Archetypes::Archetype, Factions::Faction, Patcher::Alert, Patcher::HeroContent, Races::Race, Servers::Server
- Defined in:
- lib/unchained/client/mixins/resource.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#class_name ⇒ Object
Lurk, is there not a better way to do this?.
- #to_s ⇒ Object
Class Method Details
.included(base) ⇒ Object
5 6 7 |
# File 'lib/unchained/client/mixins/resource.rb', line 5 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#class_name ⇒ Object
Lurk, is there not a better way to do this?
15 16 17 |
# File 'lib/unchained/client/mixins/resource.rb', line 15 def class_name self.class.name.split('::').last end |
#to_s ⇒ Object
9 10 11 12 |
# File 'lib/unchained/client/mixins/resource.rb', line 9 def to_s attributes = self.class::JSON_MAP.map{|k,_| "#{k}=#{self.send(k)}"}.join(" ") "[#{self.class_name}] #{attributes}" end |