class Billomat::Base

possibly ResourceWithActiveArchived

Public Class Methods

all(options={}) click to toggle source

Some common shortcuts from ActiveRecord

# File lib/billomat-rb.rb, line 144
def all(options={})
  find(:all,options)
end
coll_p(prefix_options = {}, query_options = nil) click to toggle source
# File lib/billomat-rb.rb, line 131
def coll_p(prefix_options = {}, query_options = nil)
  collection_path(prefix_options, query_options)
end
collection_path(prefix_options = {}, query_options = nil) click to toggle source
# File lib/billomat-rb.rb, line 137
def collection_path(prefix_options = {}, query_options = nil)
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
  "#{prefix(prefix_options)}#{collection_name}#{query_string(query_options)}"
end
el_p(id,prefix_options = {}, query_options = nil) click to toggle source
# File lib/billomat-rb.rb, line 127
def el_p(id,prefix_options = {}, query_options = nil)
  element_path(id,prefix_options, query_options)
end
element_path(id, prefix_options = {}, query_options = nil) click to toggle source
# File lib/billomat-rb.rb, line 122
def element_path(id, prefix_options = {}, query_options = nil)
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
  "#{prefix(prefix_options)}#{collection_name}/#{id}#{query_string(query_options)}"
end
first(options={}) click to toggle source
# File lib/billomat-rb.rb, line 148
def first(options={})
  find_every(options).first
end
inherited(base) click to toggle source

TODO somehow use json www.billomat.com/de/api/grundlagen

Calls superclass method
# File lib/billomat-rb.rb, line 110
def inherited(base)
  unless base == Billomat::SingletonBase
    Billomat.resources << base
    class << base
      attr_accessor :site_format
    end
    base.site_format = '%s'
    base.timeout = 20
  end
  super
end
last(options={}) click to toggle source
# File lib/billomat-rb.rb, line 152
def last(options={})
  find_every(options).last
end

Private Instance Methods

query_string?(options) click to toggle source
Calls superclass method
# File lib/billomat-rb.rb, line 159
def query_string?(options)
  options.is_a?(String) ? "#{options}" : super
end