eleetscript 0.0.20a → 0.0.21a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac7108d42f85a1b2d41ff8baaec1956e5d3e030d
4
- data.tar.gz: 6b884f74dce6baaa2621fcfcd47b613a0c64d266
3
+ metadata.gz: 0adb9aad298849604a85df9676a387c600ae10fd
4
+ data.tar.gz: c67b338b38b34f9dee383afd5cb8a892d4ac5704
5
5
  SHA512:
6
- metadata.gz: 84310845169662015be2056c89916ca78f60b42104c736c1965c9f4c7152d86cdd1987e89458d881116cb52b0aa0fa18aec14ba0d5e0ba806109c8906d0a4409
7
- data.tar.gz: d3a125bc0dfb51a866f8f74e2111801099acd5646daf2f4627f73e2c57c94fd589539ffec3657d32c1f00966e841b583e3619f060ccb2a83dac4c58a25a0c975
6
+ metadata.gz: 39ebded4184405856eed10b147b19338f46adb8be7ba7f5e82fed69c862b4c8713592af5c3edf47402bac57ad8bc059392fd668b6837cf450917f4dddea3890b
7
+ data.tar.gz: 5d32bfcbcf51dc342a2ecd70e508390917ab9b5eff34e7801819fa9926dbd1610e268c68ea8f8d316b6f0c5a66ba30411980441aca2bab8ca030a9dc1fb0dc85
@@ -1,4 +1,16 @@
1
1
  class Integer
2
+ round do
3
+ self
4
+ end
5
+
6
+ floor do
7
+ self
8
+ end
9
+
10
+ ceil do
11
+ self
12
+ end
13
+
2
14
  times do |iter|
3
15
  if lambda? and iter.kind_of?(Lambda)
4
16
  i = 0
@@ -41,4 +41,10 @@ class List
41
41
  end
42
42
  }
43
43
  end
44
+
45
+ pairs do
46
+ lst = []
47
+ self.each -> { |val, key| lst < (key => val) }
48
+ lst
49
+ end
44
50
  end
@@ -11,7 +11,7 @@ class Que < List
11
11
  shift
12
12
  end
13
13
 
14
- push do |val|
15
- unshift(val)
14
+ unshift do |val|
15
+ push(val)
16
16
  end
17
17
  end
@@ -14,10 +14,18 @@ module EleetScript
14
14
  if arguments.length == 0
15
15
  root_namespace["Integer"].new_with_value(receiver.ruby_value.round, context.namespace_context)
16
16
  elsif arguments.length >= 1 && arguments.first.is_a?("String", "Number")
17
- root_namespace["Float"].new_with_value(receiver.ruby_value.round(arguments.first.calL(:to_integer).ruby_value), context.namespace_context)
17
+ root_namespace["Float"].new_with_value(receiver.ruby_value.round(arguments.first.call(:to_integer).ruby_value), context.namespace_context)
18
18
  else
19
19
  root_namespace["nil"]
20
20
  end
21
21
  end
22
+
23
+ float.def :floor do |receiver, arguments, context|
24
+ root_namespace["Integer"].new_with_value(receiver.ruby_value.floor, context.namespace_context)
25
+ end
26
+
27
+ float.def :ceil do |receiver, arugments, context|
28
+ root_namespace["Integer"].new_with_value(receiver.ruby_value.ceil, context.namespace_context)
29
+ end
22
30
  end
23
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eleetscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20a
4
+ version: 0.0.21a
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Buck