Module: Videojuicer

Defined in:
lib/videojuicer/session.rb,
lib/videojuicer.rb,
lib/videojuicer/user.rb,
lib/videojuicer/campaign.rb,
lib/videojuicer/asset/base.rb,
lib/videojuicer/asset/text.rb,
lib/videojuicer/promo/base.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/criterion/base.rb,
lib/videojuicer/criterion/time.rb,
lib/videojuicer/resource/types.rb,
lib/videojuicer/campaign_policy.rb,
lib/videojuicer/resource/errors.rb,
lib/videojuicer/criterion/request.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/criterion/geolocation.rb,
lib/videojuicer/oauth/multipart_helper.rb,
lib/videojuicer/resource/property_registry.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, Promo, Resource Classes: Campaign, Presentation, 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



93
94
95
# File 'lib/videojuicer.rb', line 93

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

.configure!(options = {}) ⇒ Object



97
98
99
# File 'lib/videojuicer.rb', line 97

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

.current_scopeObject



77
78
79
# File 'lib/videojuicer.rb', line 77

def current_scope
  scopes.last
end

.default_optionsObject



105
106
107
# File 'lib/videojuicer.rb', line 105

def default_options
  @default_options
end

.enter_scope(config) ⇒ Object



81
82
83
# File 'lib/videojuicer.rb', line 81

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

.exit_all!Object



89
90
91
# File 'lib/videojuicer.rb', line 89

def exit_all!
  @scope_stack = []
end

.exit_scopeObject



85
86
87
# File 'lib/videojuicer.rb', line 85

def exit_scope
  @scope_stack.pop
end

.in_scope?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/videojuicer.rb', line 73

def in_scope?
  !@scope_stack.empty?
end

.scopesObject



69
70
71
# File 'lib/videojuicer.rb', line 69

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

.unconfigure!Object



101
102
103
# File 'lib/videojuicer.rb', line 101

def unconfigure!
  @default_options = DEFAULTS
end