class Redmine::Base

Constants

DEFAULTS

Public Class Methods

headers() click to toggle source
# File lib/redmine/base.rb, line 17
def self.headers
  new_headers = static_headers.clone
  new_headers["X-Redmine-API-Key"] = Redmine.configuration.api_key

  new_headers
end
new(attributes = {}, persisted = false) click to toggle source
Calls superclass method
# File lib/redmine/base.rb, line 8
def initialize(attributes = {}, persisted = false)
  attrs = {}
  attrs.merge!(self.class::DEFAULTS)
  attrs.merge!(Redmine.configuration.resources[self.class.element_name.to_sym] || {})
  attrs.merge!(attributes)

  super(attrs, persisted)
end

Private Class Methods

instantiate_collection(collection, original_params = {}, prefix_options = {}) click to toggle source
Calls superclass method
# File lib/redmine/base.rb, line 30
def self.instantiate_collection(collection, original_params = {}, prefix_options = {})
  collection = collection[self.collection_name] if collection.is_a? Hash and collection.has_key? self.collection_name
    
  super(collection, original_params, prefix_options)
end

Public Instance Methods

encode(options={}) click to toggle source
# File lib/redmine/base.rb, line 24
def encode(options={})
  send("to_#{self.class.format.extension}", options)
end