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.
237 238 239 240 241 242 |
# File 'lib/shopifydev/pry/commands.rb', line 237 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.
235 236 237 |
# File 'lib/shopifydev/pry/commands.rb', line 235 def json @json end |
Instance Method Details
#build ⇒ Object
244 245 246 247 248 249 250 251 |
# File 'lib/shopifydev/pry/commands.rb', line 244 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
261 262 263 264 265 266 267 |
# File 'lib/shopifydev/pry/commands.rb', line 261 def pick(ix) if ix >= @choices.length nil else @choices[ix] end end |
#print(output = nil) ⇒ Object
253 254 255 256 257 258 259 |
# File 'lib/shopifydev/pry/commands.rb', line 253 def print(output=nil) if output.nil? @lines.join("\n") else output.puts @lines.join("\n") end end |