Module: MediumApi

Defined in:
lib/medium_api.rb,
lib/medium_api/post.rb,
lib/medium_api/user.rb,
lib/medium_api/error.rb,
lib/medium_api/utils.rb,
lib/medium_api/client.rb,
lib/medium_api/version.rb,
lib/medium_api/contributor.rb,
lib/medium_api/publication.rb,
lib/medium_api/configuration.rb

Defined Under Namespace

Modules: ResourceApi, Utils Classes: Client, Configuration, Contributor, Error, Post, Publication, User

Constant Summary collapse

VERSION =
"1.0.1"

Class Method Summary collapse

Class Method Details

.clientObject



33
34
35
# File 'lib/medium_api.rb', line 33

def client
  @client ||= Client.new(api_key: configuration.api_key)
end

.configurationObject



23
24
25
# File 'lib/medium_api.rb', line 23

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



19
20
21
# File 'lib/medium_api.rb', line 19

def configure
  yield configuration
end

.meObject



27
28
29
30
31
# File 'lib/medium_api.rb', line 27

def me
  attributes = client.me

  User.new(Utils.underscore_keys(attributes))
end