class Unleashed::BaseModel
Base model for all the other models to inherit from
Attributes
attributes[R]
Public Class Methods
new(client, attributes = {})
click to toggle source
# File lib/unleashed/models/base_model.rb, line 6 def initialize(client, attributes = {}) @client = client @attributes = stringify_keys(attributes) end
Public Instance Methods
method_missing(name, *args, &block)
click to toggle source
Calls superclass method
# File lib/unleashed/models/base_model.rb, line 11 def method_missing(name, *args, &block) if @attributes.key?(name.to_s) @attributes[name.to_s] else super end end
Private Instance Methods
stringify_keys(hash)
click to toggle source
# File lib/unleashed/models/base_model.rb, line 21 def stringify_keys(hash) Hash[hash.map { |key, value| [key.to_s, value] }] end