mystique 0.1.0 → 0.1.1

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: 20e262fe91641c9a3c9c568ea5b55060883b4fe4
4
- data.tar.gz: a4b1f87e54acbc5e09d687789785cabdbf5c8926
3
+ metadata.gz: 88543a15da6a02bdd37018e92a48034fd078f18f
4
+ data.tar.gz: 4291ef1a3eb56154c04d8459555c9dc3b0bdee78
5
5
  SHA512:
6
- metadata.gz: 12ff257ec68e716b92444c821b28e4723317a03bd8539800c48e8817a88c2e09a17ecf082994f9e9fa42cd98085706e1e6cfef88f471544d3fdfa5de929ce641
7
- data.tar.gz: ad7b52d23c3957c769ec35cf7a06ee67013e3ae51d6e9ce1e15af819cf436e58c6d6de135b4fd6fe896f8bbc21b4bd4622d9b735eb9a99e343cfcf378b1d303e
6
+ metadata.gz: d4f48277ae1869fe9f6ffa7c01d4d52ed5ff2814e7a1f1248682ff1ad45ea84c694ced2d770df0b67f940791b584ad7866f8622d7e2e6c23f4b35e4aa0da4197
7
+ data.tar.gz: 5c3f8bb23cb00c2c087bb87397932ca5c5df591cac37130d94984dc7952eda65e928b6442fed8a25f8d59122baa99394b953b20b8384ce358bbd1f57077f8adf
data/lib/mystique.rb CHANGED
@@ -5,8 +5,8 @@ require "string_plus"
5
5
  module Mystique
6
6
  class Presenter
7
7
  def initialize(object, context)
8
- @__obj__ = object
9
- @__ctx__ = context
8
+ @__object__ = object
9
+ @__context__ = context
10
10
  end
11
11
 
12
12
  def self.present(object)
@@ -14,11 +14,11 @@ module Mystique
14
14
  end
15
15
 
16
16
  def h
17
- @__ctx__ || self.class.context
17
+ @__context__ || self.class.context
18
18
  end
19
19
 
20
20
  def target
21
- @__obj__
21
+ @__object__
22
22
  end
23
23
 
24
24
  private
@@ -76,9 +76,9 @@ module Mystique
76
76
 
77
77
  module_function
78
78
 
79
- def present(object, presenter: nil)
79
+ def present(object, with: nil)
80
80
  from_module &&= "#{from_module.to_s.camelcase}::"
81
- presenter_class = case presenter
81
+ presenter_class = case with
82
82
  when nil
83
83
  "#{object.class}Presenter".constantize
84
84
  when Symbol, String
@@ -1,3 +1,3 @@
1
1
  module Mystique
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mystique
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Iachetti