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.
7 8 9 |
# File 'lib/gitenv/actions.rb', line 7 def initialize context, type, files, @context, @type, @files, @options = context, type, files, end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/gitenv/actions.rb', line 5 def @options end |
Instance Method Details
#each(&block) ⇒ Object
11 12 13 14 15 |
# File 'lib/gitenv/actions.rb', line 11 def each &block @files.files(@context.from).each do |f| block.call @type.new(@context, f, @options) end end |
#each_file(&block) ⇒ Object
17 18 19 20 21 |
# File 'lib/gitenv/actions.rb', line 17 def each_file &block @files.files(@context.from).each do |f| block.call File.join(@context.from, f) end end |