Class: Pizza::Size

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(option) ⇒ Size

Returns a new instance of Size.



91
92
93
94
# File 'lib/pizza.rb', line 91

def initialize(option)
  self.text = option.text.strip
  self.value = option.css("input[name=sizeC]").first["value"]
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



89
90
91
# File 'lib/pizza.rb', line 89

def text
  @text
end

#valueObject

Returns the value of attribute value.



89
90
91
# File 'lib/pizza.rb', line 89

def value
  @value
end

Instance Method Details

#list_itemObject



96
97
98
# File 'lib/pizza.rb', line 96

def list_item
  text.gsub(/\s+/, " ").sub("人 /", "人/").sub("cm ", "cm\n  ").sub(" ¥", "\n  ¥").strip
end