Class: MediumApi::Publication

Inherits:
Struct
  • Object
show all
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

#contributorsObject

include ResourceApi



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

def contributors
    data = MediumApi.client.publication_contributors(id)

    data.map do |contributor_attributes|
        Contributor.new(Utils.underscore_keys(contributor_attributes))
    end
end