Class: Pizza::Size
- Inherits:
-
Object
- Object
- Pizza::Size
- Defined in:
- lib/pizza.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(option) ⇒ Size
constructor
A new instance of Size.
- #list_item ⇒ Object
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
#text ⇒ Object
Returns the value of attribute text.
89 90 91 |
# File 'lib/pizza.rb', line 89 def text @text end |
#value ⇒ Object
Returns the value of attribute value.
89 90 91 |
# File 'lib/pizza.rb', line 89 def value @value end |
Instance Method Details
#list_item ⇒ Object
96 97 98 |
# File 'lib/pizza.rb', line 96 def list_item text.gsub(/\s+/, " ").sub("人 /", "人/").sub("cm ", "cm\n ").sub(" ¥", "\n ¥").strip end |