justimmo_client 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/justimmo_client.gemspec +3 -0
- data/lib/justimmo_client/api/v1/models/justimmo_base.rb +1 -0
- data/lib/justimmo_client/api/v1/models/realty_marketing.rb +21 -0
- data/lib/justimmo_client/api/v1/models/realty_usage.rb +8 -4
- data/lib/justimmo_client/core/config.rb +2 -1
- data/lib/justimmo_client/core/utils.rb +4 -0
- data/lib/justimmo_client/misc.rb +7 -5
- data/lib/justimmo_client/version.rb +1 -1
- data/locales/de.yml +7 -0
- data/locales/en.yml +7 -0
- metadata +24 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca35fda69d2b9c35d6dfa8b7f79b10eb129a2ed7
|
4
|
+
data.tar.gz: b36be58f5d1c265e62ad4bf35664221797df362b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d16797d4e4d26181d2f4eef09e72df50246a14f1325a9a5a2fdd49bb9a437e050f5ec4648617d62827ffedff06b5b772573cdbe672601d543ac48dc27673dcd0
|
7
|
+
data.tar.gz: 3f80eb73170d6e615dc6a212b5207982e3f9137cba36bf7a8ae7d3bf8ffccde929b80c1ab1bac46a0ce571899af3d841c5f128a3c609fce82e1f149193a61220
|
data/.rubocop.yml
CHANGED
data/justimmo_client.gemspec
CHANGED
@@ -8,5 +8,26 @@ module JustimmoClient::V1
|
|
8
8
|
# @return [$2]
|
9
9
|
attribute :buy, Boolean
|
10
10
|
attribute :rent, Boolean
|
11
|
+
|
12
|
+
# @!group Instance Method Summary
|
13
|
+
|
14
|
+
def to_a
|
15
|
+
tmp = []
|
16
|
+
tmp << :buy if buy?
|
17
|
+
tmp << :rent if rent?
|
18
|
+
tmp
|
19
|
+
end
|
20
|
+
|
21
|
+
def map(&block)
|
22
|
+
to_a.map(&block)
|
23
|
+
end
|
24
|
+
|
25
|
+
def translated
|
26
|
+
map { |x| translate(x) }
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_s
|
30
|
+
translated.join(", ")
|
31
|
+
end
|
11
32
|
end
|
12
33
|
end
|
@@ -31,12 +31,16 @@ module JustimmoClient::V1
|
|
31
31
|
tmp
|
32
32
|
end
|
33
33
|
|
34
|
-
def to_s
|
35
|
-
to_a.join(", ")
|
36
|
-
end
|
37
|
-
|
38
34
|
def map(&block)
|
39
35
|
to_a.map(&block)
|
40
36
|
end
|
37
|
+
|
38
|
+
def translated
|
39
|
+
map { |x| translate(x) }
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_s
|
43
|
+
map_translated.join(", ")
|
44
|
+
end
|
41
45
|
end
|
42
46
|
end
|
@@ -13,7 +13,7 @@ module JustimmoClient
|
|
13
13
|
SUPPORTED_API_VERSIONS = [1].freeze
|
14
14
|
REQUIRED = %i[username password].freeze
|
15
15
|
|
16
|
-
config_accessor(:base_url) { "api.justimmo.at/rest" }
|
16
|
+
config_accessor(:base_url) { ENV.fetch("JUSTIMMO_BASE_URL", "api.justimmo.at/rest") }
|
17
17
|
config_accessor(:secure) { true }
|
18
18
|
config_accessor(:api_ver) { 1 }
|
19
19
|
config_accessor(:username) { ENV.fetch("JUSTIMMO_USERNAME", nil) }
|
@@ -43,6 +43,7 @@ module JustimmoClient
|
|
43
43
|
|
44
44
|
def url
|
45
45
|
validate_credentials
|
46
|
+
return "#{base_url}/v#{api_ver}" if self.base_url.start_with?("http")
|
46
47
|
"#{secure ? 'https' : 'http'}://#{base_url}/v#{api_ver}"
|
47
48
|
end
|
48
49
|
end
|
data/lib/justimmo_client/misc.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "active_support/inflector/inflections"
|
4
|
+
require "active_support/i18n"
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
inflect.acronym "JSON"
|
9
|
-
end
|
6
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
7
|
+
inflect.acronym "XML"
|
8
|
+
inflect.acronym "JSON"
|
10
9
|
end
|
10
|
+
|
11
|
+
I18n.load_path += Dir[File.expand_path("../../locales/*.yml", __dir__)]
|
12
|
+
I18n.default_locale = :en
|
data/locales/de.yml
ADDED
data/locales/en.yml
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: justimmo_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Auernig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -164,6 +164,26 @@ dependencies:
|
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '1'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: i18n
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.7'
|
174
|
+
- - "<="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0.9'
|
177
|
+
type: :runtime
|
178
|
+
prerelease: false
|
179
|
+
version_requirements: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0.7'
|
184
|
+
- - "<="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0.9'
|
167
187
|
description:
|
168
188
|
email: patrick.auernig@mykolab.com
|
169
189
|
executables: []
|
@@ -243,6 +263,8 @@ files:
|
|
243
263
|
- lib/justimmo_client/misc.rb
|
244
264
|
- lib/justimmo_client/option_parser.rb
|
245
265
|
- lib/justimmo_client/version.rb
|
266
|
+
- locales/de.yml
|
267
|
+
- locales/en.yml
|
246
268
|
- notes.md
|
247
269
|
homepage: https://gitlab.com/exacting/justimmo-client-ruby
|
248
270
|
licenses:
|