Sha256: 949d44c6b999e155e6d3ef2ccf0eb3fa1d316467566163641a920e161b201688

Contents?: true

Size: 637 Bytes

Versions: 8

Compression:

Stored size: 637 Bytes

Contents

module WialonApi
  # A mixin for classes that will be resolved via `#method_missing`.
  module Resolvable
    attr_reader :name

    # Creates a resolvable object keeping it's name and the object that resolved it.
    # @param [String] name The name of this resolvable.
    # @option options [Hashie::Mash] :resolver A mash holding information about the previous resolver.
    def initialize(name, options = {})
      @name = name.to_s
      @previous_resolver = options.delete(:resolver)
    end

    # Returns the sid from the previous resolver.
    # @return [String] A sid.
    def sid
      @previous_resolver.sid
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wialon_api-0.0.8 lib/wialon_api/resolvable.rb
wialon_api-0.0.7 lib/wialon_api/resolvable.rb
wialon_api-0.0.6 lib/wialon_api/resolvable.rb
wialon_api-0.0.5 lib/wialon_api/resolvable.rb
wialon_api-0.0.4 lib/wialon_api/resolvable.rb
wialon_api-0.0.3 lib/wialon_api/resolvable.rb
wialon_api-0.0.2 lib/wialon_api/resolvable.rb
wialon_api-0.0.1 lib/wialon_api/resolvable.rb