Sha256: f580abf9fc732bc9a401212e26a8ae1c4a3c57a51688eff820a8a72c12cf1852

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

require 'faraday'
require 'faraday_middleware'
require 'logger'
require 'multi_json'
require 'resource_kitling'
require 'freefeed/version'
require 'freefeed/exceptions'
require 'freefeed/client'
require 'active_support/inflector'

require 'freefeed/resources/archive'
require 'freefeed/resources/attachment'
require 'freefeed/resources/bookmarklet'
require 'freefeed/resources/comment'
require 'freefeed/resources/group'
require 'freefeed/resources/invitation'
require 'freefeed/resources/notification'
require 'freefeed/resources/password'
require 'freefeed/resources/post'
require 'freefeed/resources/request'
require 'freefeed/resources/search'
require 'freefeed/resources/session'
require 'freefeed/resources/stat'
require 'freefeed/resources/summary'
require 'freefeed/resources/timeline'
require 'freefeed/resources/user'

require 'freefeed/types'
require 'freefeed/types/bookmarklet'
require 'freefeed/types/comment'
require 'freefeed/types/post'

ResourceKitling::Resource.subclasses.each do |sc|
  sc.actions.each do |an|
    mn = "#{sc.to_s.downcase.split('::').last.pluralize}_#{an.name}"
    if Freefeed::Client.method_defined?(mn)
      raise(
        ArgumentError,
        "Method '#{mn}' is already defined on Freefeed::Client"
      )
    end
    Freefeed::Client.send(:define_method, mn) do |*args|
      sc.create(self, *args)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
freefeed-client-1.1.0 lib/freefeed.rb