Module: Transit

Defined in:
lib/transit.rb,
lib/transit/admin.rb,
lib/transit/config.rb,
lib/transit/version.rb,
lib/transit/core_ext.rb,
lib/transit/services.rb,
lib/transit/model/base.rb,
lib/transit/model/hooks.rb,
app/models/transit/asset.rb,
lib/transit/model/assets.rb,
lib/transit/model/owners.rb,
lib/transit/model/topics.rb,
lib/transit/rails/engine.rb,
lib/transit/services/ted.rb,
lib/transit/rails/railtie.rb,
lib/transit/services/base.rb,
app/models/transit/context.rb,
lib/transit/model/comments.rb,
lib/transit/services/vimeo.rb,
lib/transit/services/twitter.rb,
lib/transit/model/attachments.rb,
lib/transit/services/facebook.rb,
lib/transit/services/you_tube.rb,
app/helpers/transit/form_helper.rb,
lib/transit/builders/jst_builder.rb,
lib/transit/controller/generator.rb,
lib/transit/controller/responder.rb,
lib/transit/model/auto_increment.rb,
lib/transit/builders/form_builder.rb,
app/helpers/transit/package_helper.rb,
lib/transit/errors/invalid_context.rb,
lib/transit/builders/package_builder.rb,
lib/transit/package/post/validations.rb,
app/helpers/transit/pagination_helper.rb,
lib/transit/errors/resource_not_found.rb

Defined Under Namespace

Modules: Admin, AdminHelper, Builders, Config, Controller, CoreExt, Errors, FormHelper, Model, Package, PackageHelper, PaginationHelper, Services Classes: Asset, AssetsController, Context, ContextsController, Engine, PagesController, PostsController, Railtie, TopicsController

Constant Summary collapse

DESCRIPTIONS =
{}
VERSION =
"0.0.2"
@@mappings =
[]

Class Method Summary collapse

Class Method Details

.add_mapping(obj) ⇒ Object



48
49
50
# File 'lib/transit.rb', line 48

def self.add_mapping(obj)
  @@mappings << obj
end

.configure {|Transit::Config| ... } ⇒ Object

Yields:



52
53
54
# File 'lib/transit.rb', line 52

def self.configure(&block)
  yield Transit::Config
end

.contextsObject



56
57
58
# File 'lib/transit.rb', line 56

def self.contexts
  ["Text","Video", "Audio"]
end

.lookup(template) ⇒ Object



65
66
67
# File 'lib/transit.rb', line 65

def self.lookup(template)
  DESCRIPTIONS[template] ||= []
end

.superclass_for(template) ⇒ Object



69
70
71
72
73
# File 'lib/transit.rb', line 69

def self.superclass_for(template)
  DESCRIPTIONS[template].detect do |klass|
    klass.constantize.superclass === Object
  end
end

.track(klass, template) ⇒ Object



60
61
62
63
# File 'lib/transit.rb', line 60

def self.track(klass, template)
  DESCRIPTIONS[template] ||= []
  DESCRIPTIONS[template] |= [klass.to_s]
end