class Rhino::Model::FileModel

Public Class Methods

all() click to toggle source
# File lib/rhino/file_model.rb, line 30
def self.all
  files = Dir['db/quotes/*.json']
  files.map{|f| FileModel.new f}.select{|x| !x.nil? }
end
find(id) click to toggle source
# File lib/rhino/file_model.rb, line 24
def self.find(id)
  FileModel.new("db/quotes/#{id}.json")
rescue
  nil
end
find_by_committer(committer) click to toggle source

TODO

# File lib/rhino/file_model.rb, line 36
def self.find_by_committer(committer)
end
new(file_name) click to toggle source
# File lib/rhino/file_model.rb, line 6
def initialize(file_name)
  @file_name = file_name

  base_name = File.split(file_name)[-1]
  @id = File.basename(base_name, ".json").to_i

  obj = File.read(file_name)
  @hash = MultiJson.load(obj)
end
where(options={}) click to toggle source

TODO

# File lib/rhino/file_model.rb, line 40
def self.where(options={})
end

Public Instance Methods

[](name) click to toggle source
# File lib/rhino/file_model.rb, line 16
def [](name)
  @hash[name.to_s]
end
[]=(name, value) click to toggle source
# File lib/rhino/file_model.rb, line 20
def []=(name, value)
  @hash[name.to_s] = value
end
update_attribute(options={}) click to toggle source

TODO

# File lib/rhino/file_model.rb, line 44
def update_attribute(options={})
end