Class: Mite::Base

Inherits:
ActiveResource::Base
  • Object
show all
Defined in:
lib/mite-rb.rb

Class Method Summary collapse

Class Method Details

.all(options = {}) ⇒ Object

Common shortcuts known from ActiveRecord



129
130
131
# File 'lib/mite-rb.rb', line 129

def all(options={})
  find(:all, options)
end

.first(options = {}) ⇒ Object



133
134
135
# File 'lib/mite-rb.rb', line 133

def first(options={})
  find_every(options).first
end

.inherited(base) ⇒ Object



115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/mite-rb.rb', line 115

def inherited(base)
  unless base == Mite::SingletonBase
    Mite.resources << base
    class << base
      attr_accessor :site_format
    end
    base.headers['User-Agent'] = Mite.user_agent
    base.site_format = '%s'
    base.timeout = 20
  end
  super
end

.last(options = {}) ⇒ Object



137
138
139
# File 'lib/mite-rb.rb', line 137

def last(options={})
  find_every(options).last
end