class Nucleo::Models::Pages
Public Class Methods
all(site_id)
click to toggle source
# File lib/nucleo/models/pages.rb, line 10 def self.all(site_id) response_body = Nucleo::Requests::Page.all(site_id) Nucleo::Models::Feed.for_record(response_body) end
new(collection)
click to toggle source
# File lib/nucleo/models/pages.rb, line 6 def initialize(collection) @collection = Array(collection) end
retrieve(site_id, id)
click to toggle source
# File lib/nucleo/models/pages.rb, line 16 def self.retrieve(site_id, id) response_body = Nucleo::Requests::Page.retrieve(site_id, id) Nucleo::Models::Page.new(response_body) end
retrieve!(site_id, id)
click to toggle source
# File lib/nucleo/models/pages.rb, line 22 def self.retrieve!(site_id, id) response_body = Nucleo::Requests::Page.retrieve!(site_id, id) Nucleo::Models::Page.new(response_body) end
Public Instance Methods
each(&block)
click to toggle source
# File lib/nucleo/models/pages.rb, line 28 def each(&block) internal_collection.each(&block) end
Private Instance Methods
internal_collection()
click to toggle source
# File lib/nucleo/models/pages.rb, line 33 def internal_collection @collection.map do |r| Nucleo::Models::Page.new(r) end end