Sha256: 0ad4898388fa7777ce24c4c53ae1b1ca29dcb3e7002eb58311ab24843c0d228e

Contents?: true

Size: 1.41 KB

Versions: 11

Compression:

Stored size: 1.41 KB

Contents

module Tito
  class Event < Base

    extend Eventable::ClassMethods

    def self.resource_path(request_type = nil)
      return "events" if request_type == :all
      nil
    end

    def path
      "#{account_slug}/#{slug}"  
    end

    def put_path
      path
    end

    def post_path
      "#{account_slug}/events"
    end

    # property :title, type: :string
    # property :slug, type: :string
    # property :account_slug, type: :string
    # property :security_token, type: :string

    # def account_id
    #   attributes['account_id'] || attributes['account-id']
    # end

    # def account_id=(val)
    #   attributes['account_id'] = val
    # end

    # def security_token
    #   attributes['security_token'] || attributes['security-token']
    # end

    # def account_slug
    #   attributes['account_slug'] || attributes['account-slug']
    # end

    # class << self

    #   def get(path)
    #     parts = path.split('/')
    #     where(account_id: parts[0]).find(parts[1]).first
    #   end

    #   def path(params=nil)
    #     prefix_path = '%{account_id}'
    #     path_params = params.delete(:path) || params
    #     parts = [].unshift(prefix_path % path_params.symbolize_keys)
    #     if !params[:id]
    #       parts << 'events'
    #     end
    #     File.join(*parts)
    #     rescue KeyError
    #       raise ArgumentError, "Please make sure to include account_id"
    #   end
    # end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tito-0.3.5 lib/tito/event.rb
tito-0.3.4 lib/tito/event.rb
tito-0.3.3 lib/tito/event.rb
tito-0.3.2 lib/tito/event.rb
tito-0.3.1 lib/tito/event.rb
tito-0.3 lib/tito/event.rb
tito-0.2.10 lib/tito/event.rb
tito-0.2.9 lib/tito/event.rb
tito-0.2.8 lib/tito/event.rb
tito-0.2.7 lib/tito/event.rb
tito-0.2.6 lib/tito/event.rb