Class: Writeas::Post
Instance Attribute Summary collapse
-
#appearance ⇒ Object
readonly
Returns the value of attribute appearance.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#rtl ⇒ Object
readonly
Returns the value of attribute rtl.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize(response_body) ⇒ Post
constructor
A new instance of Post.
Constructor Details
#initialize(response_body) ⇒ Post
Returns a new instance of Post.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/writeas/post.rb', line 6 def initialize(response_body) super(response_body) @id = @data["id"] @slug = @data["slug"] @token = @data["token"] @appearance = @data["appearance"] @language = @data["language"] @rtl = @data["rtl"] @created = @data["created"] @title = @data["title"] @body = @data["body"] @tags = @data["tags"] end |
Instance Attribute Details
#appearance ⇒ Object (readonly)
Returns the value of attribute appearance.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def appearance @appearance end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def body @body end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def created @created end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def id @id end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def language @language end |
#rtl ⇒ Object (readonly)
Returns the value of attribute rtl.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def rtl @rtl end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def slug @slug end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def @tags end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def title @title end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/writeas/post.rb', line 3 def token @token end |