class StatusPage::API::ComponentList

Attributes

page_id[RW]

Public Class Methods

new(page_id) click to toggle source
# File lib/status_page/api/component_list.rb, line 9
def initialize(page_id)
  @page_id = page_id
end

Public Instance Methods

get() click to toggle source
# File lib/status_page/api/component_list.rb, line 13
def get
  @components = get_resource.map do |attributes|
    comp = Component.new attributes["id"], attributes["page_id"]
    comp.assign_attributes attributes
    comp
  end
end
resource_path() click to toggle source
# File lib/status_page/api/component_list.rb, line 21
def resource_path
  "pages/#{page_id}/components.json"
end