Class: FFXIV::Lodestone::Model
- Inherits:
-
Object
- Object
- FFXIV::Lodestone::Model
show all
- Defined in:
- lib/ffxiv/lodestone/model.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(props = {}) ⇒ Model
Returns a new instance of Model.
11
12
13
14
15
|
# File 'lib/ffxiv/lodestone/model.rb', line 11
def initialize(props = {})
props.each do |name, value|
self.send("#{name}=", value) if self.respond_to?(name)
end
end
|
Class Method Details
.find_by_name(name, server) ⇒ Object
6
7
8
|
# File 'lib/ffxiv/lodestone/model.rb', line 6
def find_by_name(name, server)
self.find_by_id(self.name_to_id(name, server))
end
|
Instance Method Details
#attributes ⇒ Object
17
18
19
20
21
22
|
# File 'lib/ffxiv/lodestone/model.rb', line 17
def attributes
instance_variables.inject({}) do |attrs, aname|
attrs[aname[1..-1].to_sym] = instance_variable_get(aname)
attrs
end
end
|