Class: Gitenv::Action
- Inherits:
-
Object
- Object
- Gitenv::Action
- Defined in:
- lib/gitenv/actions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #each_file(&block) ⇒ Object
-
#initialize(context, type, files, options) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(context, type, files, options) ⇒ Action
Returns a new instance of Action.
5 6 7 8 9 10 |
# File 'lib/gitenv/actions.rb', line 5 def initialize(context, type, files, ) @context = context @type = type @files = files @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/gitenv/actions.rb', line 3 def @options end |
Instance Method Details
#each(&block) ⇒ Object
12 13 14 15 16 |
# File 'lib/gitenv/actions.rb', line 12 def each(&block) @files.files(@context.from).each do |f| block.call @type.new(@context, f, @options) end end |
#each_file(&block) ⇒ Object
18 19 20 21 22 |
# File 'lib/gitenv/actions.rb', line 18 def each_file(&block) @files.files(@context.from).each do |f| block.call File.join(@context.from, f) end end |