blimp 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/blimp.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'blimp/version'
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "blimp"
8
8
  gem.version = Blimp::VERSION
9
- gem.authors = ["Blake Williams"]
9
+ gem.authors = ["Blake Williams", "Sixteen Eighty"]
10
10
  gem.email = ["blake@blakewilliams.me"]
11
11
  gem.description = %q{Ruby gem that implements the Blimp Public API http://dev.getblimp.com/}
12
12
  gem.summary = %q{Ruby bindings to the Blimp API}
data/lib/blimp/comment.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Blimp
2
2
  class Comment < Resource
3
3
  ATTRIBUTES = %w[comment object_pk content_type]
4
- READ_ONLY = %w[id files date_modified user date_created]
4
+ READ_ONLY = %w[id files user]
5
5
 
6
6
  define_attribute_methods ATTRIBUTES, READ_ONLY
7
7
  end
data/lib/blimp/company.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Blimp
2
2
  class Company < Resource
3
3
  ATTRIBUTES = %w[name used_projects company_users image_url used_storage]
4
- READ_ONLY = %w[id slug date_created date_modified date_due]
4
+ READ_ONLY = %w[id slug date_due]
5
5
 
6
6
  define_attribute_methods ATTRIBUTES, READ_ONLY
7
7
  end
data/lib/blimp/file.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Blimp
2
2
  class File < Resource
3
3
  ATTRIBUTES = %w[name versions project source]
4
- READ_ONLY = %w[id slug date_created date_modified created_by]
4
+ READ_ONLY = %w[slug created_by]
5
5
 
6
6
  define_attribute_methods ATTRIBUTES, READ_ONLY
7
7
  end
data/lib/blimp/goal.rb CHANGED
@@ -2,7 +2,7 @@ module Blimp
2
2
  class Goal < Resource
3
3
  ATTRIBUTES = %w[position date_rejected date_done user_rejected
4
4
  title project state assigned_to]
5
- READ_ONLY = %w[id date_modified created_by date_created]
5
+ READ_ONLY = %w[id created_by]
6
6
 
7
7
  define_attribute_methods ATTRIBUTES, READ_ONLY
8
8
  end
data/lib/blimp/project.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Blimp
2
2
  class Project < Resource
3
3
  ATTRIBUTES = %w[name state team date_due company]
4
- READ_ONLY = %w[id slug date_created date_finished date_modified date_due stats]
4
+ READ_ONLY = %w[slug date_finished date_due stats]
5
5
 
6
6
  define_attribute_methods ATTRIBUTES, READ_ONLY
7
7
  end
@@ -48,6 +48,8 @@ module Blimp
48
48
 
49
49
 
50
50
  def define_attribute_methods(attributes, read_only_attributes)
51
+ common_attributes = %w[id date_created date_modified resource_uri]
52
+ read_only_attributes = read_only_attributes | common_attributes
51
53
  @attributes = attributes | read_only_attributes
52
54
 
53
55
  @attributes.each do |name|
@@ -59,7 +61,6 @@ module Blimp
59
61
 
60
62
  def define_readonly_attributes(attributes)
61
63
  attributes.each do |name|
62
- @attributes.push name
63
64
  define_method(name) { self[name] }
64
65
  define_method("#{name}?") {!self[name]}
65
66
  end
@@ -84,7 +85,7 @@ module Blimp
84
85
  end
85
86
 
86
87
  def []=(key,value)
87
- @attributes[key] = value
88
+ @attributes[key] = value if self.respond_to?(key)
88
89
  end
89
90
 
90
91
  def [](key)
@@ -111,7 +112,8 @@ module Blimp
111
112
  attributes[key] = val
112
113
  end
113
114
  method = self.new? ? 'post' : 'put'
114
- Blimp::API.send method, uri, body: attributes.to_json
115
+ self.attributes = Blimp::API.send(method, uri, body: attributes.to_json).parsed_response
116
+ return self
115
117
  end
116
118
 
117
119
  end
data/lib/blimp/task.rb CHANGED
@@ -1,8 +1,7 @@
1
1
  module Blimp
2
2
  class Task < Resource
3
3
  ATTRIBUTES = %w[position goal user_rejected title project state assigned_to]
4
- READ_ONLY = %w[id date_done date_modified created_by date_created
5
- date_set_doing date_checked]
4
+ READ_ONLY = %w[date_done created_by date_set_doing date_checked]
6
5
 
7
6
  define_attribute_methods ATTRIBUTES, READ_ONLY
8
7
  end
data/lib/blimp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Blimp
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,11 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blimp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Blake Williams
9
+ - Sixteen Eighty
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []