class TheCommunityFarm::OrganicBoxes

Represents a list of organic veg boxes.

Attributes

html[R]

Public Class Methods

new(html:) click to toggle source
# File lib/the_community_farm/organic_boxes.rb, line 9
def initialize(html:)
  @html = html
end

Public Instance Methods

each(&block) click to toggle source
# File lib/the_community_farm/organic_boxes.rb, line 13
def each(&block)
  boxes.each(&block)
end

Private Instance Methods

boxes() click to toggle source
# File lib/the_community_farm/organic_boxes.rb, line 21
def boxes
  noko.css('.panel').map { |p| Box.new(noko: p) }
end
noko() click to toggle source
# File lib/the_community_farm/organic_boxes.rb, line 25
def noko
  @noko ||= Nokogiri::HTML(html)
end