Module: MontageRails

Defined in:
lib/montage_rails.rb,
lib/montage_rails/base.rb,
lib/montage_rails/errors.rb,
lib/montage_rails/version.rb,
lib/montage_rails/relation.rb,
lib/montage_rails/base/column.rb,
lib/montage_rails/query_cache.rb,
lib/montage_rails/log_subscriber.rb

Defined Under Namespace

Classes: AttributeMissingError, Base, LogSubscriber, MontageAPIError, QueryCache, Relation, RelationError

Constant Summary collapse

VERSION =
"0.4.10"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.domainObject

Returns the value of attribute domain.



13
14
15
# File 'lib/montage_rails.rb', line 13

def domain
  @domain
end

.no_cachingObject

Returns the value of attribute no_caching.



13
14
15
# File 'lib/montage_rails.rb', line 13

def no_caching
  @no_caching
end

.passwordObject

Returns the value of attribute password.



13
14
15
# File 'lib/montage_rails.rb', line 13

def password
  @password
end

.tokenObject

Returns the value of attribute token.



13
14
15
# File 'lib/montage_rails.rb', line 13

def token
  @token
end

.usernameObject

Returns the value of attribute username.



13
14
15
# File 'lib/montage_rails.rb', line 13

def username
  @username
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (MontageRails)

    the object that the method was called on



15
16
17
18
19
# File 'lib/montage_rails.rb', line 15

def configure
  yield self
  validate
  get_token unless token
end

.connectionObject



21
22
23
24
25
26
27
28
# File 'lib/montage_rails.rb', line 21

def connection
  @connection ||= begin
    Montage::Client.new do |c|
      c.token = token
      c.domain = domain
    end
  end
end

.notify(caller, &block) ⇒ Object



30
31
32
33
34
# File 'lib/montage_rails.rb', line 30

def notify(caller, &block)
  ActiveSupport::Notifications.instrument("reql.montage_rails", caller.payload) do
    yield
  end
end