Module: Videojuicer

Defined in:
lib/videojuicer/session.rb,
lib/videojuicer.rb,
lib/videojuicer/seed.rb,
lib/videojuicer/user.rb,
lib/videojuicer/asset.rb,
lib/videojuicer/insert.rb,
lib/videojuicer/preset.rb,
lib/videojuicer/campaign.rb,
lib/videojuicer/asset/base.rb,
lib/videojuicer/asset/text.rb,
lib/videojuicer/asset/audio.rb,
lib/videojuicer/asset/flash.rb,
lib/videojuicer/asset/image.rb,
lib/videojuicer/asset/video.rb,
lib/videojuicer/presentation.rb,
lib/videojuicer/resource/base.rb,
lib/videojuicer/asset/document.rb,
lib/videojuicer/resource/types.rb,
lib/videojuicer/resource/errors.rb,
lib/videojuicer/criterion/request.rb,
lib/videojuicer/resource/taggable.rb,
lib/videojuicer/shared/exceptions.rb,
lib/videojuicer/criterion/week_day.rb,
lib/videojuicer/oauth/proxy_factory.rb,
lib/videojuicer/oauth/request_proxy.rb,
lib/videojuicer/resource/collection.rb,
lib/videojuicer/resource/embeddable.rb,
lib/videojuicer/resource/inferrable.rb,
lib/videojuicer/shared/configurable.rb,
lib/videojuicer/criterion/date_range.rb,
lib/videojuicer/shared/liquid_helper.rb,
lib/videojuicer/criterion/geolocation.rb,
lib/videojuicer/oauth/multipart_helper.rb,
lib/videojuicer/resource/property_registry.rb,
lib/videojuicer/resource/relationships/has.rb,
lib/videojuicer/resource/relationships/belongs_to.rb

Overview

Property Registry

This module allows model classes to register properties that have setter and getter methods,
and are earmarked to be included in calls between instances of those classes and the API.

Properties are registered using a DataMapper-style syntax (ActiveRecord-style autodiscovery not
being possible).

Defined Under Namespace

Modules: Asset, Configurable, Criterion, Exceptions, OAuth, Resource, SDKLiquidHelper Classes: Campaign, Insert, Presentation, Preset, Seed, Session, User

Constant Summary collapse

DEFAULTS =
{
  :consumer_key     => nil,
  :consumer_secret  => nil,
  :token            => nil,
  :token_secret     => nil,
  :api_version      => nil,
  :seed_name        => nil,
  :user_id          => nil,
  :protocol         => "http",
  :host             => "api.videojuicer.com",
  :port             => 80
}.freeze

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



103
104
105
# File 'lib/videojuicer.rb', line 103

def [](key)
  @default_options[key]
end

.configure!(options = {}) ⇒ Object



107
108
109
# File 'lib/videojuicer.rb', line 107

def configure!(options={})
  @default_options = DEFAULTS.merge(@default_options.merge(options))
end

.current_scopeObject



87
88
89
# File 'lib/videojuicer.rb', line 87

def current_scope
  scopes.last
end

.default_optionsObject



115
116
117
# File 'lib/videojuicer.rb', line 115

def default_options
  @default_options
end

.enter_scope(config) ⇒ Object



91
92
93
# File 'lib/videojuicer.rb', line 91

def enter_scope(config)
  @scope_stack.push current_scope.merge(config)
end

.exit_all!Object



99
100
101
# File 'lib/videojuicer.rb', line 99

def exit_all!
  @scope_stack = []
end

.exit_scopeObject



95
96
97
# File 'lib/videojuicer.rb', line 95

def exit_scope
  @scope_stack.pop
end

.in_scope?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/videojuicer.rb', line 83

def in_scope?
  !@scope_stack.empty?
end

.scopesObject



79
80
81
# File 'lib/videojuicer.rb', line 79

def scopes
  ([default_options]+@scope_stack).compact
end

.unconfigure!Object



111
112
113
# File 'lib/videojuicer.rb', line 111

def unconfigure!
  @default_options = DEFAULTS
end