Class: BigKeeper::Podfile_Modle
- Inherits:
-
Object
- Object
- BigKeeper::Podfile_Modle
- Defined in:
- lib/big_keeper/model/podfile_model.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#configurations ⇒ Object
Returns the value of attribute configurations.
-
#git ⇒ Object
Returns the value of attribute git.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize(sentence) ⇒ Podfile_Modle
constructor
A new instance of Podfile_Modle.
Constructor Details
#initialize(sentence) ⇒ Podfile_Modle
Returns a new instance of Podfile_Modle.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/big_keeper/model/podfile_model.rb', line 6 def initialize(sentence) if sentence.include?('#') list = sentence.split('#') @comment = list[1] sentence = list[0] end sentence_slip_list = sentence.split(',') return if sentence_slip_list.size.zero? for piece in sentence_slip_list do if /:git =>/ =~ piece @git = $~.post_match.strip elsif /:path =>/ =~ piece @path = $~.post_match.strip elsif /:configurations =>/ =~ piece @configurations = $~.post_match.strip elsif /:branch =>/ =~ piece @branch = $~.post_match.strip elsif /:tag =>/ =~ piece @tag = $~.post_match.strip elsif /pod /=~ piece @name = $~.post_match.delete("'\n ") end # p %Q{model name:#{@name},git:#{@git},path:#{@path},config:#{@configurations},branch:#{@branch},tag:#{@tag},comment:#{@comment}} end end |
Instance Attribute Details
#branch ⇒ Object
Returns the value of attribute branch.
5 6 7 |
# File 'lib/big_keeper/model/podfile_model.rb', line 5 def branch @branch end |
#comment ⇒ Object
Returns the value of attribute comment.
5 6 7 |
# File 'lib/big_keeper/model/podfile_model.rb', line 5 def comment @comment end |
#configurations ⇒ Object
Returns the value of attribute configurations.
5 6 7 |
# File 'lib/big_keeper/model/podfile_model.rb', line 5 def configurations @configurations end |
#git ⇒ Object
Returns the value of attribute git.
5 6 7 |
# File 'lib/big_keeper/model/podfile_model.rb', line 5 def git @git end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/big_keeper/model/podfile_model.rb', line 5 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/big_keeper/model/podfile_model.rb', line 5 def path @path end |
#tag ⇒ Object
Returns the value of attribute tag.
5 6 7 |
# File 'lib/big_keeper/model/podfile_model.rb', line 5 def tag @tag end |