Class: OsunyApi::Communication::Website

Inherits:
Resource
  • Object
show all
Defined in:
lib/osuny_api/communication/website.rb

Defined Under Namespace

Classes: Page, Post

Instance Attribute Summary collapse

Attributes inherited from Resource

#client, #parent

Instance Method Summary collapse

Methods inherited from Resource

#full_path, #initialize

Constructor Details

This class inherits a constructor from OsunyApi::Resource

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/osuny_api/communication/website.rb', line 3

def id
  @id
end

Instance Method Details

#pageObject



14
15
16
# File 'lib/osuny_api/communication/website.rb', line 14

def page
  @page ||= Page.new(client: client, parent: self)
end

#pathObject



5
6
7
8
# File 'lib/osuny_api/communication/website.rb', line 5

def path
  id.nil? ? "websites/"
          : "websites/#{id}/"
end

#postObject



10
11
12
# File 'lib/osuny_api/communication/website.rb', line 10

def post
  @post ||= Post.new(client: client, parent: self)
end