Class: Post

Inherits:
Object
  • Object
show all
Defined in:
lib/craigslister/post.rb

Overview

Used for packaging Craigslist post data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Post

Returns a new instance of Post.



5
6
7
8
9
10
11
12
# File 'lib/craigslister/post.rb', line 5

def initialize(args)
  @title       = args[:title]
  @image       = args[:image]
  @price       = args[:price]
  @location    = args[:location]
  @description = args[:description]
  @url         = args[:url]
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#imageObject (readonly)

Returns the value of attribute image.



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

def image
  @image
end

#locationObject (readonly)

Returns the value of attribute location.



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

def location
  @location
end

#priceObject (readonly)

Returns the value of attribute price.



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

def price
  @price
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end