Class: Symbol

Inherits:
Object show all
Defined in:
lib/puppet/external/event-loop/better-definers.rb,
lib/puppet/util/monkey_patches.rb,
lib/puppet/external/event-loop/event-loop.rb

Overview

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



24
25
26
# File 'lib/puppet/util/monkey_patches.rb', line 24

def <=> (other)
  self.to_s <=> other.to_s
end

#imperativeObject



35
36
# File 'lib/puppet/external/event-loop/better-definers.rb', line 35

def imperative
without_punctuation.to_s + "!" end

#imperative?Boolean

Returns:

  • (Boolean)


23
24
# File 'lib/puppet/external/event-loop/better-definers.rb', line 23

def imperative?
to_s.include? "!" end

#io_state?Boolean

Returns:

  • (Boolean)


181
182
183
# File 'lib/puppet/external/event-loop/event-loop.rb', line 181

def io_state?
  EventLoop::IO_STATES.include? self
end

#predicateObject



33
34
# File 'lib/puppet/external/event-loop/better-definers.rb', line 33

def predicate
without_punctuation.to_s + "?" end

#predicate?Boolean

Returns:

  • (Boolean)


21
22
# File 'lib/puppet/external/event-loop/better-definers.rb', line 21

def predicate?
to_s.include? "?" end

#punctuated?Boolean

Returns:

  • (Boolean)


28
29
# File 'lib/puppet/external/event-loop/better-definers.rb', line 28

def punctuated?
predicate? or imperative? or writer? end

#to_zaml(z) ⇒ Object



20
21
22
23
# File 'lib/puppet/util/monkey_patches.rb', line 20

def to_zaml(z)
  z.emit("!ruby/sym ")
  to_s.to_zaml(z)
end

#without_punctuationObject



30
31
# File 'lib/puppet/external/event-loop/better-definers.rb', line 30

def without_punctuation
to_s.delete("?!=").to_sym end

#writerObject



37
38
# File 'lib/puppet/external/event-loop/better-definers.rb', line 37

def writer
without_punctuation.to_s + "=" end

#writer?Boolean

Returns:

  • (Boolean)


25
26
# File 'lib/puppet/external/event-loop/better-definers.rb', line 25

def writer?
to_s.include? "=" end