Class: Jiralicious::Project
- Defined in:
- lib/jiralicious/project.rb
Instance Attribute Summary collapse
-
#issues ⇒ Object
Returns the value of attribute issues.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(decoded_json, default = nil, &blk) ⇒ Project
constructor
Initialization ###.
Methods inherited from Base
#all, #endpoint_name, endpoint_name, fetch, find, find_all, handler, #loaded?, #method_missing, #numeric?, parent_name, #parent_name, #properties_from_hash, #reload
Methods included from Jiralicious::Parsers::FieldParser
Constructor Details
#initialize(decoded_json, default = nil, &blk) ⇒ Project
Initialization ###
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/jiralicious/project.rb', line 9 def initialize(decoded_json, default = nil, &blk) @loaded = false if decoded_json.is_a? Hash properties_from_hash(decoded_json) super(decoded_json) parse!(decoded_json) @loaded = true else decoded_json.each do |list| self.class.property :"#{list['key']}" self.merge!({list['key'] => self.class.find(list['key'])}) end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Jiralicious::Base
Instance Attribute Details
#issues ⇒ Object
Returns the value of attribute issues.
6 7 8 |
# File 'lib/jiralicious/project.rb', line 6 def issues @issues end |
Class Method Details
.issue_list(key) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jiralicious/project.rb', line 25 def issue_list(key) response = Jiralicious.search("project=#{key}", {:fields => ["id", "key"]}) i_out = Issue.new response.issues_raw.each do |issue| i_out.class.property :"#{issue["key"].gsub("-", "_")}" t = Issue.new i_out[issue["key"].gsub("-", "_")] = t.load(issue, true) end i_out end |