mumukit-platform 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4460e00194f6458405551b7166c5b6fd1c6e27339354f5497abee1473058fd9c
4
- data.tar.gz: 096df4a5dba99d8b8227b6d455332960aae389e90be7949fc63d7a79a08f7622
3
+ metadata.gz: 920ae1e633fbdb41486b34f521cecbb0dd87296675c1a322e05df7e685e2535c
4
+ data.tar.gz: 1e0d88436ab1352d2eada7c031cca7771b881914a110c1d983a5b4e0de55b431
5
5
  SHA512:
6
- metadata.gz: 53a5db9b91ba3f8fdc0229f9703bb18fef472fed8069224f64dfa3480634898a08c9a70663caad289a0a5211438f296240fbda52a518d927ac31e6e1c80639c0
7
- data.tar.gz: 422324a633f87d24a051d36a820d32d3734c089b654ae7fa8b0905c71814da45a04d9c374e03092872828f83e2c65883390694cd6f68c22c6f8205dad041390a
6
+ metadata.gz: b1ceb632828b17180c1405a2ddd4dfb65e63182cccd8ae88ad38e74dc7f946b3ba7334ffe47088493ff80276b90b62592b79d480fc4221084fce939109b64d14
7
+ data.tar.gz: c9426f3a1cb1c4b0223bbddde42dcd074a16ecfdd5672abff266212bfcce5f31ed7e4cec33f6830baa79ab0c13e1c31577b9291c205bec3e393319169bc38ace
@@ -3,10 +3,14 @@ require 'active_model'
3
3
  class Mumukit::Platform::Model
4
4
  include ActiveModel::Model
5
5
 
6
+ def empty?
7
+ as_json.empty?
8
+ end
9
+
6
10
  def self.model_attr_accessor(*keys)
7
11
  attr_accessor(*keys)
8
- define_singleton_method :parse do |json|
9
- new json.slice(*keys)
12
+ define_singleton_method :parse do |hash|
13
+ hash ? new(hash.slice(*keys)) : new
10
14
  end
11
15
  end
12
16
 
@@ -15,6 +19,6 @@ class Mumukit::Platform::Model
15
19
  end
16
20
 
17
21
  def self.load(json)
18
- new JSON.parse(json)
22
+ json ? new(JSON.parse(json)) : new
19
23
  end
20
24
  end
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Platform
3
- VERSION = '0.10.0'
3
+ VERSION = '0.11.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-platform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2018-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit-core
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.7.4
140
+ rubygems_version: 2.7.5
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Shared Mumuki Platform Components