Class: Phcpresspro::Phcpressproindexapi
- Inherits:
-
Object
- Object
- Phcpresspro::Phcpressproindexapi
- Includes:
- HTTParty
- Defined in:
- lib/phcpresspro/apis/phcpressproapi.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#pstimage ⇒ Object
Returns the value of attribute pstimage.
-
#pststatus ⇒ Object
Returns the value of attribute pststatus.
-
#psttext ⇒ Object
Returns the value of attribute psttext.
-
#psttitle ⇒ Object
Returns the value of attribute psttitle.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response) ⇒ Phcpressproindexapi
constructor
A new instance of Phcpressproindexapi.
Constructor Details
#initialize(response) ⇒ Phcpressproindexapi
Returns a new instance of Phcpressproindexapi.
14 15 16 17 18 19 20 |
# File 'lib/phcpresspro/apis/phcpressproapi.rb', line 14 def initialize(response) @phc_press_pro_id = response['phcpresspro_article_post']['id'] @phc_press_pro_psttitle = response['phcpresspro_article_post']['psttitle'] @phc_press_pro_psttext = response['phcpresspro_article_post']['psttext'] @phc_press_pro_pststatus = response['phcpresspro_article_post']['pststatus'] @phc_press_pro_pstimage = response['phcpresspro_article_post']['pstimage'] end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/phcpresspro/apis/phcpressproapi.rb', line 12 def id @id end |
#pstimage ⇒ Object
Returns the value of attribute pstimage.
12 13 14 |
# File 'lib/phcpresspro/apis/phcpressproapi.rb', line 12 def pstimage @pstimage end |
#pststatus ⇒ Object
Returns the value of attribute pststatus.
12 13 14 |
# File 'lib/phcpresspro/apis/phcpressproapi.rb', line 12 def pststatus @pststatus end |
#psttext ⇒ Object
Returns the value of attribute psttext.
12 13 14 |
# File 'lib/phcpresspro/apis/phcpressproapi.rb', line 12 def psttext @psttext end |
#psttitle ⇒ Object
Returns the value of attribute psttitle.
12 13 14 |
# File 'lib/phcpresspro/apis/phcpressproapi.rb', line 12 def psttitle @psttitle end |
Class Method Details
.get_phcpresspro_index_api ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/phcpresspro/apis/phcpressproapi.rb', line 22 def self.get_phcpresspro_index_api response = get("/cms/api/v1/posts.json") if response.success? new(response) else raise response.response end end |