Class: Qor::Test::Gem
- Inherits:
-
Object
- Object
- Qor::Test::Gem
- Defined in:
- lib/qor_test/gem.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(node, gem_option = nil) ⇒ Gem
constructor
A new instance of Gem.
- #to_s ⇒ Object
Constructor Details
#initialize(node, gem_option = nil) ⇒ Gem
Returns a new instance of Gem.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/qor_test/gem.rb', line 6 def initialize(node, gem_option=nil) self.name = node.name.to_s self. = gem_option.is_a?(Array) ? gem_option : [gem_option] [:git, :path, :platforms].map do |type| if node.parent.is_node?(type) parent_option = {type => node.parent.value}.merge(node.parent.) if [-1].is_a?(Hash) self.[-1] = parent_option.merge([-1]) else self..push(parent_option) end end end end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/qor_test/gem.rb', line 4 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/qor_test/gem.rb', line 4 def @options end |
Class Method Details
Instance Method Details
#to_s ⇒ Object
22 23 24 25 26 |
# File 'lib/qor_test/gem.rb', line 22 def to_s result = %{gem "#{name}"} result += %{, #{.map(&:inspect).join(", ")}} if .length > 0 result end |