Class: MediumApi::Publication

Inherits:
Struct
  • Object
show all
Includes:
ResourceApi
Defined in:
lib/medium_api/publication.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



2
3
4
# File 'lib/medium_api/publication.rb', line 2

def description
  @description
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



2
3
4
# File 'lib/medium_api/publication.rb', line 2

def id
  @id
end

#image_urlObject

Returns the value of attribute image_url

Returns:

  • (Object)

    the current value of image_url



2
3
4
# File 'lib/medium_api/publication.rb', line 2

def image_url
  @image_url
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/medium_api/publication.rb', line 2

def name
  @name
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



2
3
4
# File 'lib/medium_api/publication.rb', line 2

def url
  @url
end

Instance Method Details

#contributorsArray<Contributor>

Returns:



6
7
8
9
10
11
# File 'lib/medium_api/publication.rb', line 6

def contributors
  data = client.publication_contributors(id)
  data.map do |contributor_attrs|
    Contributor.new(Utils.underscore_keys(contributor_attrs))
  end
end