Class: Writeas::Post

Inherits:
Response show all
Defined in:
lib/writeas/post.rb

Instance Attribute Summary collapse

Attributes inherited from Response

#code

Instance Method Summary collapse

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

#appearanceObject (readonly)

Returns the value of attribute appearance.



3
4
5
# File 'lib/writeas/post.rb', line 3

def appearance
  @appearance
end

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/writeas/post.rb', line 3

def body
  @body
end

#createdObject (readonly)

Returns the value of attribute created.



3
4
5
# File 'lib/writeas/post.rb', line 3

def created
  @created
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/writeas/post.rb', line 3

def id
  @id
end

#languageObject (readonly)

Returns the value of attribute language.



3
4
5
# File 'lib/writeas/post.rb', line 3

def language
  @language
end

#rtlObject (readonly)

Returns the value of attribute rtl.



3
4
5
# File 'lib/writeas/post.rb', line 3

def rtl
  @rtl
end

#slugObject (readonly)

Returns the value of attribute slug.



3
4
5
# File 'lib/writeas/post.rb', line 3

def slug
  @slug
end

#tagsObject (readonly)

Returns the value of attribute tags.



3
4
5
# File 'lib/writeas/post.rb', line 3

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/writeas/post.rb', line 3

def title
  @title
end

#tokenObject (readonly)

Returns the value of attribute token.



3
4
5
# File 'lib/writeas/post.rb', line 3

def token
  @token
end