roxo 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/roxo.rb +4 -1
  2. data/roxo.gemspec +1 -1
  3. metadata +2 -2
@@ -10,7 +10,6 @@ class ROXO
10
10
  attr_reader :raw, :name, :value, :children
11
11
  def __attributes; @attributes.sort; end
12
12
  def attributes; @attributes.keys; end
13
- def terminal?; @children.size.zero?; end # A node is terminal if we can't descend any further
14
13
  def has?(o); !! send(o); end # Boolean. Does this exist?
15
14
  def [](o); @attributes[o.to_s]; end # Only lookup attributes
16
15
  def to_s; @value; end
@@ -27,6 +26,10 @@ class ROXO
27
26
  terminal? ? value.inspect : "#<ROXO:0x#{object_id.to_s(16)} @name=\"#{@name}\", ...>"
28
27
  end
29
28
 
29
+ def terminal?
30
+ @children.size.zero? and @attributes.size.zero?
31
+ end # A node is terminal if we can't descend any further
32
+
30
33
  def <=>(other)
31
34
  [:class, :__attributes, :value, :name].each do |key|
32
35
  return z unless (z = self.send(key) <=> other.send(key)).zero?
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'roxo'
3
- gem.version = '0.1.5'
3
+ gem.version = '0.1.6'
4
4
 
5
5
  gem.author, gem.email = 'Burke Libbey', "burke@burkelibbey.org"
6
6
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Burke Libbey