Class: GhostRb::Resources::Tag

Inherits:
BaseResource show all
Defined in:
lib/ghost_rb/resources/tag.rb

Overview

Author:

  • Rene Hernandez

Since:

  • 0.1

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from BaseResource

hash_value?

Methods included from Support::Hydratable

#hydrate

Instance Attribute Details

#idObject

Since:

  • 0.1



8
9
10
# File 'lib/ghost_rb/resources/tag.rb', line 8

def id
  @id
end

#nameObject

Since:

  • 0.1



8
9
10
# File 'lib/ghost_rb/resources/tag.rb', line 8

def name
  @name
end

#posts_countObject

Since:

  • 0.1



8
9
10
# File 'lib/ghost_rb/resources/tag.rb', line 8

def posts_count
  @posts_count
end

#slugObject

Since:

  • 0.1



8
9
10
# File 'lib/ghost_rb/resources/tag.rb', line 8

def slug
  @slug
end

#visibilityObject

Since:

  • 0.1



8
9
10
# File 'lib/ghost_rb/resources/tag.rb', line 8

def visibility
  @visibility
end

Class Method Details

.generate(hash) ⇒ Object

Since:

  • 0.1



10
11
12
13
14
15
# File 'lib/ghost_rb/resources/tag.rb', line 10

def self.generate(hash)
  inst = super(hash)
  inst.posts_count = hash[:count][:posts].to_i if hash.key?(:count)

  inst
end