class Fabricio::Model::AbstractModel
Defines a base class for all data models
Attributes
json[RW]
Plain data from the server
Public Instance Methods
method_missing(*args)
click to toggle source
We use ‘method_missing` approach here to allow a user query any field from the original data structure sent by server.
# File lib/fabricio/models/abstract_model.rb, line 9 def method_missing(*args) method_name = args.first json_value = @json[method_name.to_s] return json_value if json_value raise NoMethodError.new("There's no method called #{args.first} here -- please try again.", args.first) end