Class: ConfigMenu
- Inherits:
-
Object
- Object
- ConfigMenu
- Defined in:
- lib/shopifydev/pry/commands.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
Returns the value of attribute json.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(json, style = :default) ⇒ ConfigMenu
constructor
A new instance of ConfigMenu.
- #pick(ix) ⇒ Object
- #print(output = nil) ⇒ Object
Constructor Details
#initialize(json, style = :default) ⇒ ConfigMenu
Returns a new instance of ConfigMenu.
238 239 240 241 242 243 |
# File 'lib/shopifydev/pry/commands.rb', line 238 def initialize(json, style=:default) @json = json @style = style @choices = [:do_nothing] @lines = [] end |
Instance Attribute Details
#json ⇒ Object
Returns the value of attribute json.
236 237 238 |
# File 'lib/shopifydev/pry/commands.rb', line 236 def json @json end |
Instance Method Details
#build ⇒ Object
245 246 247 248 249 250 251 252 |
# File 'lib/shopifydev/pry/commands.rb', line 245 def build case @style when :development then build_development when :default then build_default when :heroku then build_heroku else build_missing end end |
#pick(ix) ⇒ Object
262 263 264 265 266 267 268 |
# File 'lib/shopifydev/pry/commands.rb', line 262 def pick(ix) if ix >= @choices.length nil else @choices[ix] end end |
#print(output = nil) ⇒ Object
254 255 256 257 258 259 260 |
# File 'lib/shopifydev/pry/commands.rb', line 254 def print(output=nil) if output.nil? @lines.join("\n") else output.puts @lines.join("\n") end end |